Documentation ¶
Index ¶
- Constants
- func SeekAndCopySyncPkg(it *Iterator, p *proto.PkgMultiOp, migration bool, migUnitId uint16) bool
- type Authorize
- type DB
- func (db *DB) Close()
- func (db *DB) Commit(wb *WriteBatch) error
- func (db *DB) Del(rawKey []byte, wb *WriteBatch) error
- func (db *DB) Get(opt *ReadOptions, rawKey []byte) ([]byte, error)
- func (db *DB) NewIterator(opt *ReadOptions) *Iterator
- func (db *DB) NewReadOptions(createSnapshot bool) *ReadOptions
- func (db *DB) NewWriteBatch() *WriteBatch
- func (db *DB) Open(name string, createIfMissing bool, maxOpenFiles int, writeBufSize int, ...) error
- func (db *DB) Put(rawKey, value []byte, wb *WriteBatch) error
- type Iterator
- func (iter *Iterator) Destroy()
- func (iter *Iterator) Key() []byte
- func (iter *Iterator) Next()
- func (iter *Iterator) Prev()
- func (iter *Iterator) Seek(key []byte)
- func (iter *Iterator) SeekToFirst()
- func (iter *Iterator) SeekToLast()
- func (iter *Iterator) Valid() bool
- func (iter *Iterator) Value() []byte
- type PkgArgs
- type ReadOptions
- type Table
- func (tbl *Table) Auth(req *PkgArgs, au Authorize) []byte
- func (tbl *Table) Close()
- func (tbl *Table) Del(req *PkgArgs, au Authorize, wa *WriteAccess) ([]byte, bool)
- func (tbl *Table) DeleteUnit(unitId uint16) error
- func (tbl *Table) Dump(req *PkgArgs, au Authorize) []byte
- func (tbl *Table) Get(req *PkgArgs, au Authorize, wa *WriteAccess) []byte
- func (tbl *Table) GetRWMutex() *sync.RWMutex
- func (tbl *Table) HasUnitData(unitId uint16) bool
- func (tbl *Table) Incr(req *PkgArgs, au Authorize, wa *WriteAccess) ([]byte, bool)
- func (tbl *Table) MDel(req *PkgArgs, au Authorize, wa *WriteAccess) ([]byte, bool)
- func (tbl *Table) MGet(req *PkgArgs, au Authorize, wa *WriteAccess) []byte
- func (tbl *Table) MIncr(req *PkgArgs, au Authorize, wa *WriteAccess) ([]byte, bool)
- func (tbl *Table) MSet(req *PkgArgs, au Authorize, wa *WriteAccess) ([]byte, bool)
- func (tbl *Table) NewIterator(fillCache bool) *Iterator
- func (tbl *Table) Scan(req *PkgArgs, au Authorize) []byte
- func (tbl *Table) Set(req *PkgArgs, au Authorize, wa *WriteAccess) ([]byte, bool)
- func (tbl *Table) SetPassword(dbId uint8, password string)
- func (tbl *Table) Sync(req *PkgArgs) ([]byte, bool)
- type TableLock
- type UnitLock
- type WriteAccess
- type WriteBatch
Constants ¶
View Source
const ( KeyFullSyncEnd = "full-sync-end" KeyIncrSyncEnd = "incr-sync-end" KeySyncLogMissing = "sync-log-missing" )
AdminDB keys, reserved tableId=0(no migration on this table)
Variables ¶
This section is empty.
Functions ¶
func SeekAndCopySyncPkg ¶
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) Commit ¶
func (db *DB) Commit(wb *WriteBatch) error
func (*DB) NewIterator ¶
func (db *DB) NewIterator(opt *ReadOptions) *Iterator
func (*DB) NewReadOptions ¶
func (db *DB) NewReadOptions(createSnapshot bool) *ReadOptions
func (*DB) NewWriteBatch ¶
func (db *DB) NewWriteBatch() *WriteBatch
type Iterator ¶
type Iterator struct {
// contains filtered or unexported fields
}
func (*Iterator) SeekToFirst ¶
func (iter *Iterator) SeekToFirst()
func (*Iterator) SeekToLast ¶
func (iter *Iterator) SeekToLast()
type ReadOptions ¶
type ReadOptions struct {
// contains filtered or unexported fields
}
func (*ReadOptions) Destroy ¶
func (opt *ReadOptions) Destroy()
func (*ReadOptions) SetFillCache ¶
func (opt *ReadOptions) SetFillCache(fillCache bool)
type Table ¶
type Table struct {
// contains filtered or unexported fields
}
func (*Table) DeleteUnit ¶ added in v1.0.3
func (*Table) GetRWMutex ¶
func (*Table) HasUnitData ¶ added in v1.0.3
func (*Table) NewIterator ¶
func (*Table) SetPassword ¶
type TableLock ¶
type TableLock struct {
// contains filtered or unexported fields
}
func NewTableLock ¶
func NewTableLock() *TableLock
type WriteAccess ¶
type WriteAccess struct {
// contains filtered or unexported fields
}
func NewWriteAccess ¶
func NewWriteAccess(replication bool, mc *config.MasterConfig) *WriteAccess
func (*WriteAccess) Check ¶
func (m *WriteAccess) Check() bool
return false: no right to write! return true: may have right to write, need to check key or unit again
func (*WriteAccess) CheckKey ¶
func (m *WriteAccess) CheckKey(dbId, tableId uint8, rowKey []byte) bool
Do we have right to write this key?
func (*WriteAccess) CheckUnit ¶ added in v1.0.3
func (m *WriteAccess) CheckUnit(unitId uint16) bool
Do we have right to write this unit?
type WriteBatch ¶
type WriteBatch struct {
// contains filtered or unexported fields
}
func (*WriteBatch) Destroy ¶
func (wb *WriteBatch) Destroy()
Click to show internal directories.
Click to hide internal directories.