Documentation ¶
Index ¶
- Constants
- Variables
- type BBoltDB
- func (b *BBoltDB) Close()
- func (b *BBoltDB) Del(key string) error
- func (b *BBoltDB) GC() error
- func (b *BBoltDB) Get(k string) ([]byte, error)
- func (b *BBoltDB) Incr(k string, by int64) (int64, error)
- func (b *BBoltDB) MDel(keys []string) error
- func (b *BBoltDB) MGet(keys []string) [][]byte
- func (b *BBoltDB) MSet(data map[string][]byte) error
- func (b *BBoltDB) Scan(scannerOpt ScannerOptions) error
- func (b *BBoltDB) Set(k string, v []byte, ttl time.Duration) error
- func (b *BBoltDB) Size() int64
- func (b *BBoltDB) TTL(key string) int64
- type BuntDB
- func (bdb *BuntDB) Close()
- func (bdb *BuntDB) Del(key string) error
- func (bdb *BuntDB) GC() error
- func (bdb *BuntDB) Get(k string) ([]byte, error)
- func (bdb *BuntDB) Incr(k string, by int64) (int64, error)
- func (bdb *BuntDB) MDel(keys []string) error
- func (bdb *BuntDB) MGet(keys []string) [][]byte
- func (bdb *BuntDB) MSet(data map[string][]byte) error
- func (bdb *BuntDB) Scan(opt ScannerOptions) error
- func (bdb *BuntDB) Set(k string, v []byte, ttl time.Duration) error
- func (bdb *BuntDB) Size() int64
- func (bdb *BuntDB) TTL(key string) int64
- 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 PogrebDB
- func (pdb *PogrebDB) Close()
- func (pdb *PogrebDB) Del(key string) error
- func (pdb *PogrebDB) GC() error
- func (pdb *PogrebDB) Get(k string) ([]byte, error)
- func (pdb *PogrebDB) Incr(k string, by int64) (int64, error)
- func (pdb *PogrebDB) MDel(keys []string) error
- func (pdb *PogrebDB) MGet(keys []string) [][]byte
- func (pdb *PogrebDB) MSet(data map[string][]byte) error
- func (pdb *PogrebDB) Scan(scannerOpt ScannerOptions) error
- func (pdb *PogrebDB) Set(k string, v []byte, ttl time.Duration) error
- func (pdb *PogrebDB) Size() int64
- func (pdb *PogrebDB) TTL(key string) int64
- type ScannerOptions
Constants ¶
View Source
const Megabyte = 1 << 20
Variables ¶
View Source
var ( ErrNotImplemented = errors.New("not implemented") ErrNotFound = errors.New("not found") ErrNoData = errors.New("no data") ErrNotSupported = errors.New("not supported") )
View Source
var (
OpenPogrebDB func(string) (DB, error)
)
Functions ¶
This section is empty.
Types ¶
type BBoltDB ¶ added in v0.0.2
BBoltDB - represents a bbolt db implementation
func OpenBoltDBB ¶ added in v0.0.2
OpenBoltDB - Opens the specified path
func (*BBoltDB) Scan ¶ added in v0.0.2
func (b *BBoltDB) Scan(scannerOpt ScannerOptions) error
Scan - iterate over the whole store using the handler function
type BuntDB ¶ added in v0.0.3
BuntDB - represents a BuntDB implementation
func OpenBuntDB ¶ added in v0.0.3
OpenBuntDB - Opens the specified path
func (*BuntDB) Scan ¶ added in v0.0.3
func (bdb *BuntDB) Scan(opt ScannerOptions) error
Scan - iterate over the whole store using the handler function
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 PogrebDB ¶ added in v0.0.2
PogrebDB - represents a pogreb db implementation
func (*PogrebDB) Scan ¶ added in v0.0.2
func (pdb *PogrebDB) 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.