store

package
v0.0.0-...-a369a49 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2014 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func Repair

func Repair(cfg *config.Config) error

Types

type DB

type DB struct {
	driver.IDB
}

func Open

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

func (*DB) Begin

func (db *DB) Begin() (*Tx, error)

func (*DB) NewIterator

func (db *DB) NewIterator() *Iterator

func (*DB) NewSnapshot

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

func (*DB) NewWriteBatch

func (db *DB) NewWriteBatch() WriteBatch

func (*DB) RangeIterator

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

func (*DB) RangeLimitIterator

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

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

func (*DB) RevRangeLimitIterator

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.

type Iterator

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

func (*Iterator) BufKey

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

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

func (it *Iterator) Close()

func (*Iterator) Find

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

Finds by key, if not found, nil returns.

func (*Iterator) Key

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

Returns a copy of key.

func (*Iterator) Next

func (it *Iterator) Next()

func (*Iterator) Prev

func (it *Iterator) Prev()

func (*Iterator) RawFind

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

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

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

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

func (*Iterator) SeekToFirst

func (it *Iterator) SeekToFirst()

func (*Iterator) SeekToLast

func (it *Iterator) SeekToLast()

func (*Iterator) Valid

func (it *Iterator) Valid() bool

func (*Iterator) Value

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

Returns a copy of value.

type Limit

type Limit struct {
	Offset int
	Count  int
}

type Range

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

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

func NewRangeIterator

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

func NewRangeLimitIterator

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

func NewRevRangeIterator

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

func NewRevRangeLimitIterator

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

func (*RangeLimitIterator) BufKey

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

func (*RangeLimitIterator) BufValue

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

func (*RangeLimitIterator) Close

func (it *RangeLimitIterator) Close()

func (*RangeLimitIterator) Key

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

func (*RangeLimitIterator) Next

func (it *RangeLimitIterator) Next()

func (*RangeLimitIterator) RawKey

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

func (*RangeLimitIterator) RawValue

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

func (*RangeLimitIterator) Valid

func (it *RangeLimitIterator) Valid() bool

func (*RangeLimitIterator) Value

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

type Snapshot

type Snapshot struct {
	driver.ISnapshot
}

func (*Snapshot) NewIterator

func (s *Snapshot) NewIterator() *Iterator

type Tx

type Tx struct {
	driver.Tx
}

func (*Tx) NewIterator

func (tx *Tx) NewIterator() *Iterator

func (*Tx) NewWriteBatch

func (tx *Tx) NewWriteBatch() WriteBatch

func (*Tx) RangeIterator

func (tx *Tx) RangeIterator(min []byte, max []byte, rangeType uint8) *RangeLimitIterator

func (*Tx) RangeLimitIterator

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

count < 0, unlimit.

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

func (*Tx) RevRangeIterator

func (tx *Tx) RevRangeIterator(min []byte, max []byte, rangeType uint8) *RangeLimitIterator

func (*Tx) RevRangeLimitIterator

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

count < 0, unlimit.

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

type WriteBatch

type WriteBatch interface {
	driver.IWriteBatch
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL