Documentation ¶
Index ¶
- Variables
- func Decode(valueBytes []byte, valuePtr interface{}) error
- func Encode(value interface{}) ([]byte, error)
- type Compressor
- type Config
- type Db
- func (db *Db) Close() error
- func (db *Db) Config() Config
- func (db *Db) Count() int
- func (db *Db) Delete(key interface{}) error
- func (db *Db) Flush() error
- func (db *Db) Get(key interface{}, valuePtr interface{}) error
- func (db *Db) Iterate(f func(gobKeyBytes, gobValueBytes []byte) (continueIteration bool)) error
- func (db *Db) Set(key interface{}, value interface{}) error
- func (db *Db) Shrink(filePath string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNotFound = errors.New("not found")
)
View Source
var NoneCompressor = new(noneCompressor)
NoneCompressor provides no compression.
View Source
var XzCompressor = new(xzCompressor)
XzCompressor provides LZMA2 compression
View Source
var ZstdCompressor = new(zstdCompressor)
ZstdCompressor provides Zstandard compression
Functions ¶
Types ¶
type Compressor ¶ added in v0.2.1
type Compressor interface { Compress([]byte) ([]byte, error) Decompress([]byte) ([]byte, error) Id() int8 Init() error }
Compressor represents compressor interface
type Config ¶ added in v0.2.1
type Config struct { BlockDataSize int64 Compressor Compressor ReadOnly bool }
Config represents storage config options
type Db ¶ added in v0.2.1
type Db struct {
// contains filtered or unexported fields
}
Db represents key/value storage.
func OpenWithConfig ¶ added in v0.2.1
OpenWithConfig opens storage with specified config options.
func (*Db) Iterate ¶ added in v0.2.1
Iterate provedes fastest possible method of all record iteration.
Click to show internal directories.
Click to hide internal directories.