ledisdb: github.com/siddontang/ledisdb/store Index | Files | Directories

package store

import "github.com/siddontang/ledisdb/store"

Index

Package Files

db.go iterator.go slice.go snapshot.go stat.go store.go writebatch.go

Constants

const (
    IteratorForward  uint8 = 0
    IteratorBackward uint8 = 1
)
const (
    RangeClose uint8 = 0x00
    RangeLOpen uint8 = 0x01
    RangeROpen uint8 = 0x10
    RangeOpen  uint8 = 0x11
)

func Repair Uses

func Repair(cfg *config.Config) error

type BatchData Uses

type BatchData struct {
    leveldb.Batch
}

func NewBatchData Uses

func NewBatchData(data []byte) (*BatchData, error)

func (*BatchData) Data Uses

func (d *BatchData) Data() []byte

func (*BatchData) Items Uses

func (d *BatchData) Items() ([]BatchItem, error)

func (*BatchData) Replay Uses

func (d *BatchData) Replay(r BatchDataReplay) error

func (*BatchData) Reset Uses

func (d *BatchData) Reset()

type BatchDataReplay Uses

type BatchDataReplay interface {
    Put(key, value []byte)
    Delete(key []byte)
}

type BatchItem Uses

type BatchItem struct {
    Key   []byte
    Value []byte
}

type DB Uses

type DB struct {
    // contains filtered or unexported fields
}

func Open Uses

func Open(cfg *config.Config) (*DB, error)

func (*DB) Close Uses

func (db *DB) Close() error

func (*DB) Compact Uses

func (db *DB) Compact() error

func (*DB) Delete Uses

func (db *DB) Delete(key []byte) error

func (*DB) Get Uses

func (db *DB) Get(key []byte) ([]byte, error)

func (*DB) GetSlice Uses

func (db *DB) GetSlice(key []byte) (Slice, error)

func (*DB) NewIterator Uses

func (db *DB) NewIterator() *Iterator

func (*DB) NewSnapshot Uses

func (db *DB) NewSnapshot() (*Snapshot, error)

func (*DB) NewWriteBatch Uses

func (db *DB) NewWriteBatch() *WriteBatch

func (*DB) Put Uses

func (db *DB) Put(key []byte, value []byte) error

func (*DB) RangeIterator Uses

func (db *DB) RangeIterator(min []byte, max []byte, rangeType uint8) *RangeLimitIterator

func (*DB) RangeLimitIterator Uses

func (db *DB) RangeLimitIterator(min []byte, max []byte, rangeType uint8, offset int, count int) *RangeLimitIterator

count < 0, unlimit.

offset must >= 0, if < 0, will get nothing.

func (*DB) RevRangeIterator Uses

func (db *DB) RevRangeIterator(min []byte, max []byte, rangeType uint8) *RangeLimitIterator

func (*DB) RevRangeLimitIterator Uses

func (db *DB) RevRangeLimitIterator(min []byte, max []byte, rangeType uint8, offset int, count int) *RangeLimitIterator

count < 0, unlimit.

offset must >= 0, if < 0, will get nothing.

func (*DB) Stat Uses

func (db *DB) Stat() *Stat

func (*DB) String Uses

func (db *DB) String() string

type Iterator Uses

type Iterator struct {
    // contains filtered or unexported fields
}

func (*Iterator) BufKey Uses

func (it *Iterator) BufKey(b []byte) []byte

Copy key to b, if b len is small or nil, returns a new one.

func (*Iterator) BufValue Uses

func (it *Iterator) BufValue(b []byte) []byte

Copy value to b, if b len is small or nil, returns a new one.

func (*Iterator) Close Uses

func (it *Iterator) Close()

func (*Iterator) Find Uses

func (it *Iterator) Find(key []byte) []byte

Finds by key, if not found, nil returns.

func (*Iterator) Key Uses

func (it *Iterator) Key() []byte

Returns a copy of key.

func (*Iterator) Next Uses

func (it *Iterator) Next()

func (*Iterator) Prev Uses

func (it *Iterator) Prev()

func (*Iterator) RawFind Uses

func (it *Iterator) RawFind(key []byte) []byte

Finds by key, if not found, nil returns, else a reference of value returns. you must be careful that it will be changed after next iterate.

func (*Iterator) RawKey Uses

func (it *Iterator) RawKey() []byte

Returns a reference of key. you must be careful that it will be changed after next iterate.

func (*Iterator) RawValue Uses

func (it *Iterator) RawValue() []byte

Returns a reference of value. you must be careful that it will be changed after next iterate.

func (*Iterator) Seek Uses

func (it *Iterator) Seek(key []byte)

func (*Iterator) SeekToFirst Uses

func (it *Iterator) SeekToFirst()

func (*Iterator) SeekToLast Uses

func (it *Iterator) SeekToLast()

func (*Iterator) Valid Uses

func (it *Iterator) Valid() bool

func (*Iterator) Value Uses

func (it *Iterator) Value() []byte

Returns a copy of value.

type Limit Uses

type Limit struct {
    Offset int
    Count  int
}

type Range Uses

type Range struct {
    Min []byte
    Max []byte

    Type uint8
}

min must less or equal than max

range type:

close: [min, max]
open: (min, max)
lopen: (min, max]
ropen: [min, max)

type RangeLimitIterator Uses

type RangeLimitIterator struct {
    // contains filtered or unexported fields
}

func NewRangeIterator Uses

func NewRangeIterator(i *Iterator, r *Range) *RangeLimitIterator

func NewRangeLimitIterator Uses

func NewRangeLimitIterator(i *Iterator, r *Range, l *Limit) *RangeLimitIterator

func NewRevRangeIterator Uses

func NewRevRangeIterator(i *Iterator, r *Range) *RangeLimitIterator

func NewRevRangeLimitIterator Uses

func NewRevRangeLimitIterator(i *Iterator, r *Range, l *Limit) *RangeLimitIterator

func (*RangeLimitIterator) BufKey Uses

func (it *RangeLimitIterator) BufKey(b []byte) []byte

func (*RangeLimitIterator) BufValue Uses

func (it *RangeLimitIterator) BufValue(b []byte) []byte

func (*RangeLimitIterator) Close Uses

func (it *RangeLimitIterator) Close()

func (*RangeLimitIterator) Key Uses

func (it *RangeLimitIterator) Key() []byte

func (*RangeLimitIterator) Next Uses

func (it *RangeLimitIterator) Next()

func (*RangeLimitIterator) RawKey Uses

func (it *RangeLimitIterator) RawKey() []byte

func (*RangeLimitIterator) RawValue Uses

func (it *RangeLimitIterator) RawValue() []byte

func (*RangeLimitIterator) Valid Uses

func (it *RangeLimitIterator) Valid() bool

func (*RangeLimitIterator) Value Uses

func (it *RangeLimitIterator) Value() []byte

type Slice Uses

type Slice interface {
    driver.ISlice
}

type Snapshot Uses

type Snapshot struct {
    driver.ISnapshot
    // contains filtered or unexported fields
}

func (*Snapshot) Close Uses

func (s *Snapshot) Close()

func (*Snapshot) Get Uses

func (s *Snapshot) Get(key []byte) ([]byte, error)

func (*Snapshot) GetSlice Uses

func (s *Snapshot) GetSlice(key []byte) (Slice, error)

func (*Snapshot) NewIterator Uses

func (s *Snapshot) NewIterator() *Iterator

type Stat Uses

type Stat struct {
    GetNum               sync2.AtomicInt64
    GetMissingNum        sync2.AtomicInt64
    GetTotalTime         sync2.AtomicDuration
    PutNum               sync2.AtomicInt64
    DeleteNum            sync2.AtomicInt64
    IterNum              sync2.AtomicInt64
    IterSeekNum          sync2.AtomicInt64
    IterCloseNum         sync2.AtomicInt64
    SnapshotNum          sync2.AtomicInt64
    SnapshotCloseNum     sync2.AtomicInt64
    BatchNum             sync2.AtomicInt64
    BatchCommitNum       sync2.AtomicInt64
    BatchCommitTotalTime sync2.AtomicDuration
    TxNum                sync2.AtomicInt64
    TxCommitNum          sync2.AtomicInt64
    TxCloseNum           sync2.AtomicInt64
    CompactNum           sync2.AtomicInt64
    CompactTotalTime     sync2.AtomicDuration
}

func (*Stat) Reset Uses

func (st *Stat) Reset()

type WriteBatch Uses

type WriteBatch struct {
    // contains filtered or unexported fields
}

func (*WriteBatch) BatchData Uses

func (wb *WriteBatch) BatchData() *BatchData

the data will be undefined after commit or rollback

func (*WriteBatch) Close Uses

func (wb *WriteBatch) Close()

func (*WriteBatch) Commit Uses

func (wb *WriteBatch) Commit() error

func (*WriteBatch) Data Uses

func (wb *WriteBatch) Data() []byte

func (*WriteBatch) Delete Uses

func (wb *WriteBatch) Delete(key []byte)

func (*WriteBatch) Put Uses

func (wb *WriteBatch) Put(key []byte, value []byte)

func (*WriteBatch) Rollback Uses

func (wb *WriteBatch) Rollback() error

Directories

PathSynopsis
driver
goleveldb
leveldb
rocksdb

Package store imports 13 packages (graph) and is imported by 30 packages. Updated 2017-12-02. Refresh now. Tools for package owners.