aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <sokolyuk@gmail.com>2021-11-22 13:48:13 +0100
committerDimitri Sokolyuk <sokolyuk@gmail.com>2021-11-22 13:48:13 +0100
commit172fe8ad99288d4a4976089955a75bd28f5da764 (patch)
tree2f0e150e6cefa00bf5f263d360a1d48c3f4f8d31
parent7b80152c65d5086f0dff9cc3e1c0bf5b1e4354dd (diff)
Simplify
-rw-r--r--db.go32
1 files changed, 7 insertions, 25 deletions
diff --git a/db.go b/db.go
index d4fc49e..a40dbd0 100644
--- a/db.go
+++ b/db.go
@@ -8,14 +8,6 @@ var (
ErrInval = errors.New("parameter is incompatible with the current file specification")
)
-type DBType int
-
-const (
- DBBTree DBType = iota
- DBHash
- DBRecno
-)
-
type Flag int
// Routine flags
@@ -33,22 +25,12 @@ const (
RRecnoSync // sync (recno)
)
-// DBT is mnemonic for "data base thang"
-type DBT struct {
- Data interface{}
- Size int64
-}
-
type DB interface {
- Close() error
- Del(key []byte, flags uint) error
- Fd() uintptr
- Get(key []byte, flags uint) ([]byte, error)
- Put(key, data []byte, flags uint) error
- Sync(flags uint) error
- Seq(key []byte, flags uint) ([]byte, error)
-}
-
-func OpenFile(name string, flags, mode int, typ DBType, openinfo interface{}) (DB, error) {
- return nil, nil
+ Close() (err error)
+ Del(key []byte, flag uint) (err error)
+ Fd() (fd uintptr)
+ Get(key []byte, flag uint) (data []byte, err error)
+ Put(key []byte, data []byte, flag uint) (err error)
+ Sync(flag uint) (err error)
+ Seq(flag uint) (key []byte, data []byte, err error)
}