Documentation ¶
Index ¶
- type Config
- type KVStore
- func (s *KVStore) DeleteKey(ctx context.Context, key string, opts ...clientv3.OpOption) (*clientv3.DeleteResponse, error)
- func (s *KVStore) GetValue(ctx context.Context, key string, opts ...clientv3.OpOption) (*clientv3.GetResponse, error)
- func (s *KVStore) IsPeerRunning(ctx context.Context, peerID string, timeout time.Duration) (int, bool)
- func (s *KVStore) SetValue(ctx context.Context, key, val string, opts ...clientv3.OpOption) (*clientv3.PutResponse, error)
- func (s *KVStore) Shutdown() error
- func (s *KVStore) UpdateEndpoints() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config defines the distributed store config
type KVStore ¶
type KVStore struct { clientv3.KV clientv3.Lease clientv3.Watcher // Namespaced Session for session and concurrency operations in the KVStore *concurrency.Session *clientv3.Client // contains filtered or unexported fields }
KVStore defines a clustered key value store
func (*KVStore) DeleteKey ¶
func (s *KVStore) DeleteKey(ctx context.Context, key string, opts ...clientv3.OpOption) (*clientv3.DeleteResponse, error)
DeleteKey deletes a given key from the store
func (*KVStore) GetValue ¶
func (s *KVStore) GetValue(ctx context.Context, key string, opts ...clientv3.OpOption) (*clientv3.GetResponse, error)
GetValue retrieves the value of a given key from the store
func (*KVStore) IsPeerRunning ¶
func (s *KVStore) IsPeerRunning(ctx context.Context, peerID string, timeout time.Duration) (int, bool)
IsPeerRunning checks whether the given peer is up running
func (*KVStore) SetValue ¶
func (s *KVStore) SetValue(ctx context.Context, key, val string, opts ...clientv3.OpOption) (*clientv3.PutResponse, error)
SetValue sets the value of a given key unto the store
func (*KVStore) UpdateEndpoints ¶
UpdateEndpoints updates the configured endpoints and saves them
Click to show internal directories.
Click to hide internal directories.