Documentation ¶
Overview ¶
Package etcd 是 jsonstore 使用 etcd 作为 backend 的实现
Index ¶
- type OpOption
- type Option
- type Store
- func (s *Store) Get(pctx context.Context, key string) (storetypes.KeyValue, error)
- func (s *Store) GetClient() *clientv3.Client
- func (s *Store) NewSTM(f func(stm stm.JSONStoreSTMOP) error) error
- func (s *Store) PrefixGet(pctx context.Context, prefix string) ([]storetypes.KeyValue, error)
- func (s *Store) PrefixGetKey(pctx context.Context, prefix string) ([]storetypes.Key, error)
- func (s *Store) PrefixRemove(pctx context.Context, prefix string) ([]storetypes.KeyValue, error)
- func (s *Store) Put(pctx context.Context, key, value string) error
- func (s *Store) PutWithOption(ctx context.Context, key, value string, opts []interface{}) (interface{}, error)
- func (s *Store) PutWithRev(ctx context.Context, key, value string) (int64, error)
- func (s *Store) Remove(pctx context.Context, key string) (*storetypes.KeyValue, error)
- func (s *Store) Watch(ctx context.Context, key string, isPrefix, filterDelete bool) (storetypes.WatchChan, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store etcd backend 的 storetypes.Store 实现
func (*Store) NewSTM ¶
func (s *Store) NewSTM(f func(stm stm.JSONStoreSTMOP) error) error
NewSTM etcd concurrency.NewSTM + json (un)marshal
func (*Store) PrefixGetKey ¶
PrefixGetKey 只获取 key
func (*Store) PrefixRemove ¶
PrefixRemove 删除 prefix 开头的所有 kv
func (*Store) PutWithOption ¶
func (s *Store) PutWithOption(ctx context.Context, key, value string, opts []interface{}) (interface{}, error)
PutWithOption 向 etcd 写入 kv 时能指定 option
func (*Store) PutWithRev ¶
PutWithRev 向 etcd 写入 kv,并且返回 revision
Click to show internal directories.
Click to hide internal directories.