Documentation
¶
Index ¶
- Constants
- Variables
- type Config
- type DB
- func (db *DB) Close()
- func (db *DB) Delete(key string, opts ...Option) error
- func (db *DB) Flush() error
- func (db *DB) Get(key string, opts ...Option) Val
- func (db *DB) List(opts ...Option) map[string][]byte
- func (db *DB) Set(key string, val Val, opts ...Option) error
- func (db *DB) Tx(f func(tx *Tx) error) error
- func (db *DB) Watch(ctx context.Context, key string, opts ...Option) <-chan WatchResponse
- type Op
- type OpType
- type Option
- type Record
- type SubWatcher
- type Tx
- type Val
- type WatchEvent
- type WatchResponse
- type Watcher
Constants ¶
View Source
const DefaultWatcherQueueSize = 1024
View Source
const RecordHeaderSize = 2 + 4 + 4 + 8 + 8
Variables ¶
View Source
var (
ErrInvalidRecord = errors.New("invalid record")
)
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Op)
func WithCreateNotify ¶
func WithCreateNotify() Option
func WithDeleteNotify ¶
func WithDeleteNotify() Option
func WithPrefix ¶
func WithPrefix() Option
func WithPrefixKey ¶
func WithUpdateNotify ¶
func WithUpdateNotify() Option
func WithWatchEventBuffSize ¶
type Record ¶
type SubWatcher ¶
type SubWatcher struct {
// contains filtered or unexported fields
}
func (*SubWatcher) PushEvent ¶
func (sw *SubWatcher) PushEvent(e *WatchEvent)
type WatchResponse ¶
type WatchResponse struct { Wid string Event *WatchEvent Canceled bool }
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
func NewWatcher ¶
func NewWatcher() *Watcher
func (*Watcher) AddEvent ¶
func (w *Watcher) AddEvent(event *WatchEvent)
Click to show internal directories.
Click to hide internal directories.