Documentation ¶
Overview ¶
内存 + etcd, 内存中的数据自动与 etcd 中同步
Index ¶
- type MemEtcdStore
- func (s *MemEtcdStore) Get(ctx context.Context, key string) (storetypes.KeyValue, error)
- func (s *MemEtcdStore) PrefixGet(ctx context.Context, prefix string) ([]storetypes.KeyValue, error)
- func (s *MemEtcdStore) PrefixGetKey(ctx context.Context, prefix string) ([]storetypes.Key, error)
- func (s *MemEtcdStore) PrefixRemove(pctx context.Context, prefix string) ([]storetypes.KeyValue, error)
- func (s *MemEtcdStore) Put(ctx context.Context, key, value string) error
- func (s *MemEtcdStore) PutWithOption(ctx context.Context, key, value string, opts []interface{}) (interface{}, error)
- func (s *MemEtcdStore) Remove(ctx context.Context, key string) (*storetypes.KeyValue, error)
- func (s *MemEtcdStore) Watch(ctx context.Context, key string, isPrefix bool, filterDelete bool) (storetypes.WatchChan, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemEtcdStore ¶
type MemEtcdStore struct { // 保护 revision 的修改 && em与etcd之间的同步修改 sync.Mutex // contains filtered or unexported fields }
func New ¶
func New(ctx context.Context, etcdDir string, cb func(k, v string, t storetypes.ChangeType)) (*MemEtcdStore, error)
func (*MemEtcdStore) Get ¶
func (s *MemEtcdStore) Get(ctx context.Context, key string) (storetypes.KeyValue, error)
func (*MemEtcdStore) PrefixGet ¶
func (s *MemEtcdStore) PrefixGet(ctx context.Context, prefix string) ([]storetypes.KeyValue, error)
func (*MemEtcdStore) PrefixGetKey ¶
func (s *MemEtcdStore) PrefixGetKey(ctx context.Context, prefix string) ([]storetypes.Key, error)
func (*MemEtcdStore) PrefixRemove ¶
func (s *MemEtcdStore) PrefixRemove(pctx context.Context, prefix string) ([]storetypes.KeyValue, error)
func (*MemEtcdStore) PutWithOption ¶
func (s *MemEtcdStore) PutWithOption(ctx context.Context, key, value string, opts []interface{}) (interface{}, error)
func (*MemEtcdStore) Remove ¶
func (s *MemEtcdStore) Remove(ctx context.Context, key string) (*storetypes.KeyValue, error)
Click to show internal directories.
Click to hide internal directories.