Documentation
¶
Index ¶
- type DB
- type LevelDB
- func (ldb *LevelDB) Close()
- func (ldb *LevelDB) Del(key string) error
- func (ldb *LevelDB) GC() error
- func (ldb *LevelDB) Get(k string) ([]byte, error)
- func (ldb *LevelDB) Incr(k string, by int64) (int64, error)
- func (ldb *LevelDB) MDel(keys []string) error
- func (ldb *LevelDB) MGet(keys []string) [][]byte
- func (ldb *LevelDB) MSet(data map[string][]byte) error
- func (ldb *LevelDB) Scan(scannerOpt ScannerOptions) error
- func (ldb *LevelDB) Set(k string, v []byte, ttl time.Duration) error
- func (ldb *LevelDB) Size() int64
- func (ldb *LevelDB) TTL(key string) int64
- type ScannerOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB interface {
Incr(k string, by int64) (int64, error)
Set(k string, v []byte, ttl time.Duration) error
MSet(data map[string][]byte) error
Get(k string) ([]byte, error)
MGet(keys []string) [][]byte
TTL(key string) int64
MDel(keys []string) error
Del(key string) error
Scan(ScannerOpt ScannerOptions) error
Size() int64
GC() error
Close()
}
DB Interface
type LevelDB ¶
LevelDB - represents a leveldb db implementation
func OpenLevelDB ¶
OpenLevelDB - Opens the specified path
func (*LevelDB) Scan ¶
func (ldb *LevelDB) Scan(scannerOpt ScannerOptions) error
Scan - iterate over the whole store using the handler function
type ScannerOptions ¶
type ScannerOptions struct {
// from where to start
Offset string
// whether to include the value of the offset in the result or not
IncludeOffset bool
// the prefix that must be exists in each key in the iteration
Prefix string
// fetch the values (true) or this is a key only iteration (false)
FetchValues bool
// the handler that handles the incoming data
Handler func(k []byte, v []byte) error
}
ScannerOptions - represents the options for a scanner
Click to show internal directories.
Click to hide internal directories.