Documentation ¶
Overview ¶
Package template contains the Example store implementation. This package is a template only.
Index ¶
- Constants
- type Config
- type Store
- func (s Store) AtomicDelete(ctx context.Context, key string, previous *store.KVPair) (bool, error)
- func (s Store) AtomicPut(ctx context.Context, key string, value []byte, previous *store.KVPair, ...) (bool, *store.KVPair, error)
- func (w *Store) Close() error
- func (s Store) Delete(ctx context.Context, key string) error
- func (s Store) DeleteTree(ctx context.Context, directory string) error
- func (s Store) Exists(ctx context.Context, key string, opts *store.ReadOptions) (bool, error)
- func (s Store) Get(ctx context.Context, key string, opts *store.ReadOptions) (*store.KVPair, error)
- func (s Store) List(ctx context.Context, directory string, opts *store.ReadOptions) ([]*store.KVPair, error)
- func (s Store) NewLock(ctx context.Context, key string, opts *store.LockOptions) (store.Locker, error)
- func (s Store) Put(ctx context.Context, key string, value []byte, opts *store.WriteOptions) error
- func (s *Store) Watch(ctx context.Context, key string, opts *store.ReadOptions) (<-chan *store.KVPair, error)
- func (s Store) WatchTree(ctx context.Context, directory string, opts *store.ReadOptions) (<-chan []*store.KVPair, error)
Constants ¶
View Source
const StoreName = "filekv"
StoreName the name of the store. TODO implement me.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
ProtoconfRoot string
}
Config the Example configuration. TODO implement me.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store implements the store.Store interface. TODO implement me.
func (Store) AtomicDelete ¶
AtomicDelete Atomic delete of a single value.
func (Store) AtomicPut ¶
func (s Store) AtomicPut(ctx context.Context, key string, value []byte, previous *store.KVPair, opts *store.WriteOptions) (bool, *store.KVPair, error)
AtomicPut Atomic CAS operation on a single value. Pass previous = nil to create a new key.
func (Store) DeleteTree ¶
DeleteTree deletes a range of keys under a given directory.
func (Store) List ¶
func (s Store) List(ctx context.Context, directory string, opts *store.ReadOptions) ([]*store.KVPair, error)
List the content of a given prefix.
func (Store) NewLock ¶
func (s Store) NewLock(ctx context.Context, key string, opts *store.LockOptions) (store.Locker, error)
NewLock creates a lock for a given key. The returned Locker is not held and must be acquired with `.Lock`. The Value is optional.
Click to show internal directories.
Click to hide internal directories.