Documentation ¶
Index ¶
- Constants
- Variables
- func BackupReader(dst string, src io.Reader) error
- func BackupWriter(src string, dst io.Writer) error
- func DisableStrictMode()
- func EnableStrictMode()
- func New(cfg Config) (store.Store, error)
- func PrefixKey(prefix []byte) string
- func ReadTTL(md *nutsdb.MetaData) uint32
- func WatchKey(key []byte) (hash uint64)
- type Config
- type DB
- func (s *DB) Begin(writable bool) (*nutsdb.Tx, error)
- func (s *DB) Break(ctx context.Context) error
- func (s *DB) Close() error
- func (s *DB) Current() string
- func (s *DB) DB() (*nutsdb.DB, error)
- func (s *DB) Del(key []byte) error
- func (s *DB) Get(key []byte) (*store.Value, error)
- func (s *DB) PrefixScan(prefix []byte, offset, limit int) ([]*store.Value, error)
- func (s *DB) PrefixSearchScan(prefix []byte, reg string, offset, limit int) ([]*store.Value, error)
- func (s *DB) Restore(src io.Reader) (err error)
- func (s *DB) Set(key, value []byte) error
- func (s *DB) SetWithTTL(key, value []byte, ttl uint32) error
- func (s *DB) Snapshot() (io.Reader, error)
- func (s *DB) State() uint32
- func (s *DB) Swap(namespace string) (store.Actions, error)
- func (s *DB) Transaction(writable bool, fn func(tx *nutsdb.Tx) error) error
- func (s *DB) TrySet(key, value []byte) error
- func (s *DB) TrySetWithTTL(key, value []byte, ttl uint32) error
- func (s *DB) Watch(key []byte) (store.Watcher, error)
- func (s *DB) WatchPrefix(prefix []byte) store.Watcher
- type RWMode
- type Watcher
- type WatcherChannel
- type WatcherChild
- type WatcherNotifier
Constants ¶
View Source
const ( StateOk uint32 = iota StateBreak )
View Source
const ( // FileIO represents the read and write mode using standard I/O. FileIO = nutsdb.FileIO // MMap represents the read and write mode using mmap. MMap = nutsdb.MMap )
View Source
const WatcherNotifyBufferSize = 32
Variables ¶
View Source
var ( KeyInitBucket = []byte("_init_key") ErrStateBreak = errors.New("state break") )
Functions ¶
func DisableStrictMode ¶
func DisableStrictMode()
func EnableStrictMode ¶
func EnableStrictMode()
func WatchKey ¶
WatchKey from: https://en.wikipedia.org/wiki/Jenkins_hash_function (Jenkins' One-At-A-Time hashing)
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) PrefixScan ¶
func (*DB) PrefixSearchScan ¶
func (*DB) Transaction ¶
type Watcher ¶
func (*Watcher) UseTarget ¶
func (w *Watcher) UseTarget(namespace string) *WatcherChild
type WatcherChannel ¶
type WatcherChannel struct { PrefixWatch bool Value *[]byte Prefix []byte Notify sync.Map // map[string]*WatcherNotifier // contains filtered or unexported fields }
func (*WatcherChannel) AddNotifier ¶
func (c *WatcherChannel) AddNotifier(dest *WatcherNotifier)
type WatcherChild ¶
type WatcherChild struct { Namespace string Channels sync.Map // map[uint64]*WatcherChannel PrefixChannels sync.Map // map[string]*WatcherChannel }
func (*WatcherChild) Update ¶
func (c *WatcherChild) Update(key, value []byte, ttl uint32)
func (*WatcherChild) Watch ¶
func (c *WatcherChild) Watch(key []byte) *WatcherNotifier
func (*WatcherChild) WatchPrefix ¶
func (c *WatcherChild) WatchPrefix(prefix []byte) *WatcherNotifier
type WatcherNotifier ¶
type WatcherNotifier struct { Values chan *store.WatchValue UUID string // contains filtered or unexported fields }
func (*WatcherNotifier) Close ¶
func (n *WatcherNotifier) Close() error
func (*WatcherNotifier) Notify ¶
func (n *WatcherNotifier) Notify() chan *store.WatchValue
Click to show internal directories.
Click to hide internal directories.