Documentation ¶
Index ¶
- func EtcdEventStateToHandlerState(eventType mvccpb.Event_EventType, isCreate bool, isModify bool) string
- func Get(handlerName string) (datastore.Store, error)
- func NewETCD() (datastore.Store, error)
- func RegisterFlags(cmd *cobra.Command)
- type ETCD
- func (st *ETCD) Delete(ctx context.Context, key string, opts ...clientv3.OpOption) (*clientv3.DeleteResponse, error)
- func (st *ETCD) Get(ctx context.Context, key string, opts ...clientv3.OpOption) (*clientv3.GetResponse, error)
- func (st *ETCD) Put(ctx context.Context, key string, value string, opts ...clientv3.OpOption) (*clientv3.PutResponse, error)
- func (st *ETCD) PutTTL(ctx context.Context, key string, value string, ttl int64, ...) (*clientv3.PutResponse, error)
- func (st *ETCD) SetKeyPrefix(prefix string)
- func (st *ETCD) Watch(ctx context.Context, key string, opts ...clientv3.OpOption) clientv3.WatchChan
- type ETCDOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EtcdEventStateToHandlerState ¶
func EtcdEventStateToHandlerState(eventType mvccpb.Event_EventType, isCreate bool, isModify bool) string
EtcdEventStateToHandlerState convert Etcd client v3 event type to our own states.
func RegisterFlags ¶
RegisterFlags register flags using the function provided in flagRegisters var.
Types ¶
type ETCD ¶
ETCD implementation of datastore.Store interface for ETCD.
func (*ETCD) Delete ¶
func (st *ETCD) Delete(ctx context.Context, key string, opts ...clientv3.OpOption) (*clientv3.DeleteResponse, error)
Delete delete a key value pair.
func (*ETCD) Get ¶
func (st *ETCD) Get(ctx context.Context, key string, opts ...clientv3.OpOption) (*clientv3.GetResponse, error)
Get return a specific key.
func (*ETCD) Put ¶
func (st *ETCD) Put(ctx context.Context, key string, value string, opts ...clientv3.OpOption) (*clientv3.PutResponse, error)
Put set a key to a specific value.
func (*ETCD) PutTTL ¶
func (st *ETCD) PutTTL(ctx context.Context, key string, value string, ttl int64, opts ...clientv3.OpOption) (*clientv3.PutResponse, error)
PutTTL set a key to a specific value with a TTL.
func (*ETCD) SetKeyPrefix ¶
SetKeyPrefix set the prefix to prefix all given keys with.
type ETCDOptions ¶
type ETCDOptions struct { CACert string Cert string CommandTimeout time.Duration Debug bool DialTimeout time.Duration DiscoverySRV string Endpoints []string InsecureDiscovery bool InsecureSkipTLSVerify bool InsecureTransport bool KeepaliveTime time.Duration KeepaliveTimeout time.Duration Key string User string }
ETCDOptions options for ETCD connection. Just the flags of `ETCDCTL_API=3 etcdctl` (etcdtctl version `3.3.8`, API version `3.3`) copied.
Click to show internal directories.
Click to hide internal directories.