Versions in this module Expand all Collapse all v1 v1.0.0 Feb 28, 2019 Changes in this version + const NoCompression + const SnappyCompression + var ErrDBClosed = errors.New("database is closed") + func DestroyComparator(cmp *C.leveldb_comparator_t) + func DestroyDatabase(dbname string, o *Options) error + func GetLevelDBMajorVersion() int + func GetLevelDBMinorVersion() int + func RepairDatabase(dbname string, o *Options) error + type Cache struct + Cache *C.leveldb_cache_t + func NewLRUCache(capacity int) *Cache + func (c *Cache) Close() + type CompressionOpt int + type DB struct + Ldb *C.leveldb_t + func Open(dbname string, o *Options) (*DB, error) + func (db *DB) Close() + func (db *DB) CompactRange(r Range) + func (db *DB) Delete(wo *WriteOptions, key []byte) error + func (db *DB) Get(ro *ReadOptions, key []byte) ([]byte, error) + func (db *DB) GetApproximateSizes(ranges []Range) []uint64 + func (db *DB) NewIterator(ro *ReadOptions) *Iterator + func (db *DB) NewSnapshot() *Snapshot + func (db *DB) PropertyValue(propName string) string + func (db *DB) Put(wo *WriteOptions, key, value []byte) error + func (db *DB) ReleaseSnapshot(snap *Snapshot) + func (db *DB) Write(wo *WriteOptions, w *WriteBatch) error + type DatabaseError string + func (e DatabaseError) Error() string + type Env struct + Env *C.leveldb_env_t + func NewDefaultEnv() *Env + func (env *Env) Close() + type FilterPolicy struct + Policy *C.leveldb_filterpolicy_t + func NewBloomFilter(bitsPerKey int) *FilterPolicy + func (fp *FilterPolicy) Close() + type Iterator struct + Iter *C.leveldb_iterator_t + func (it *Iterator) Close() + func (it *Iterator) GetError() error + func (it *Iterator) Key() []byte + func (it *Iterator) Next() + func (it *Iterator) Prev() + func (it *Iterator) Seek(key []byte) + func (it *Iterator) SeekToFirst() + func (it *Iterator) SeekToLast() + func (it *Iterator) Valid() bool + func (it *Iterator) Value() []byte + type IteratorError string + func (e IteratorError) Error() string + type Options struct + Opt *C.leveldb_options_t + func NewOptions() *Options + func (o *Options) Close() + func (o *Options) SetBlockRestartInterval(n int) + func (o *Options) SetBlockSize(s int) + func (o *Options) SetCache(cache *Cache) + func (o *Options) SetComparator(cmp *C.leveldb_comparator_t) + func (o *Options) SetCompression(t CompressionOpt) + func (o *Options) SetCreateIfMissing(b bool) + func (o *Options) SetEnv(env *Env) + func (o *Options) SetErrorIfExists(error_if_exists bool) + func (o *Options) SetFilterPolicy(fp *FilterPolicy) + func (o *Options) SetInfoLog(log *C.leveldb_logger_t) + func (o *Options) SetMaxOpenFiles(n int) + func (o *Options) SetParanoidChecks(pc bool) + func (o *Options) SetWriteBufferSize(s int) + type Range struct + Limit []byte + Start []byte + type ReadOptions struct + Opt *C.leveldb_readoptions_t + func NewReadOptions() *ReadOptions + func (ro *ReadOptions) Close() + func (ro *ReadOptions) SetFillCache(b bool) + func (ro *ReadOptions) SetSnapshot(snap *Snapshot) + func (ro *ReadOptions) SetVerifyChecksums(b bool) + type Snapshot struct + type WriteBatch struct + func NewWriteBatch() *WriteBatch + func (w *WriteBatch) Clear() + func (w *WriteBatch) Close() + func (w *WriteBatch) Delete(key []byte) + func (w *WriteBatch) Put(key, value []byte) + type WriteOptions struct + Opt *C.leveldb_writeoptions_t + func NewWriteOptions() *WriteOptions + func (wo *WriteOptions) Close() + func (wo *WriteOptions) SetSync(b bool)