Documentation ¶
Index ¶
- func IsNop(kv KV) bool
- type Config
- type KV
- type Measured
- func (m *Measured) Del(ctx context.Context, key string) error
- func (m *Measured) Get(ctx context.Context, key string) ([]byte, error)
- func (m *Measured) GetPrefix(ctx context.Context, prefix string) (map[string][]byte, error)
- func (m *Measured) Put(ctx context.Context, key string, value string) error
- func (m *Measured) Start(ctx context.Context) error
- func (m *Measured) Stop(ctx context.Context) error
- func (m *Measured) Watch(ctx context.Context, prefix string, withPrevVal bool) <-chan kvtypes.WatchResp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type KV ¶
type KV interface { // Put stores a new value associated to a given key. Put(ctx context.Context, key string, value string) error // Get retrieves a value associated to a given key. Get(ctx context.Context, key string) ([]byte, error) // GetPrefix retrieves all values whose key matches prefix. GetPrefix(ctx context.Context, prefix string) (map[string][]byte, error) // Del deletes a value associated to a given key. Del(ctx context.Context, key string) error // Watch watches on a key or prefix. Watch(ctx context.Context, prefix string, withPrevVal bool) <-chan kvtypes.WatchResp // Start initializes key-value store. Start(ctx context.Context) error // Stop releases all underlying key-value store resources. Stop(ctx context.Context) error }
KV represents a generic key-value store interface.
type Measured ¶
type Measured struct {
// contains filtered or unexported fields
}
Measured represents a measured KV type.
func NewMeasured ¶
NewMeasured returns an initialized measured KV instance.
Click to show internal directories.
Click to hide internal directories.