Documentation
¶
Overview ¶
Package storetypes define jsonstore public types
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChangeType ¶
type ChangeType int
ChangeType kv 变化类型
const ( // Add 新增 kv Add ChangeType = iota // Del 删除 kv Del // Update 更新 kv Update )
func (ChangeType) String ¶
func (c ChangeType) String() string
type KeyValueWithChangeType ¶
type KeyValueWithChangeType struct {
KeyValue
T ChangeType
}
KeyValueWithChangeType = KeyValue + ChangeType
type Store ¶
type Store interface {
Put(ctx context.Context, key, value string) error
Get(ctx context.Context, key string) (KeyValue, error)
Remove(ctx context.Context, key string) (*KeyValue, error)
PrefixRemove(pctx context.Context, prefix string) ([]KeyValue, error)
PrefixGet(ctx context.Context, prefix string) ([]KeyValue, error)
PrefixGetKey(ctx context.Context, prefix string) ([]Key, error)
PutWithOption(ctx context.Context, key, value string, opts []interface{}) (interface{}, error)
}
Store 包括了实现 backend 所需的基本接口
type StoreWithSTM ¶
type StoreWithSTM interface {
Store
stm.JSONStoreSTM
}
StoreWithSTM = Store + STM
type StoreWithWatch ¶
type StoreWithWatch interface {
Store
Watch(ctx context.Context, key string, isPrefix bool, filterDelete bool) (WatchChan, error)
}
StoreWithWatch = Store + Watch
type WatchResponse ¶
type WatchResponse struct {
Kvs []KeyValueWithChangeType
Err error
}
WatchResponse watch 到的 kv 变化结果
Click to show internal directories.
Click to hide internal directories.