Documentation ¶
Index ¶
- type Cli
- func (cli *Cli) Delete(ctx context.Context, key string) error
- func (cli *Cli) DeleteWithPrefix(ctx context.Context, key string) error
- func (cli *Cli) KeepAlive(ctx context.Context, key, value string, ttl int64) (clientv3.LeaseID, error)
- func (cli *Cli) KeepAliveOnce(ctx context.Context, key, value string, ttl int64) error
- func (cli *Cli) Put(ctx context.Context, key, value string) error
- func (cli *Cli) PutWithNotExist(ctx context.Context, key, value string) (bool, error)
- func (cli *Cli) Revoke(ctx context.Context, id clientv3.LeaseID) error
- func (cli *Cli) Watch(ctx context.Context, key string) *WatchKeyResponse
- func (cli *Cli) WatchWithPrefix(ctx context.Context, prefix string) *WatchKeyResponse
- type EventType
- type KeyChangeEvent
- type WatchKeyResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cli ¶
type Cli struct {
// contains filtered or unexported fields
}
func NewEtcdClient ¶
new a etcd client
func (*Cli) DeleteWithPrefix ¶
delete with prefix
func (*Cli) KeepAlive ¶
func (cli *Cli) KeepAlive(ctx context.Context, key, value string, ttl int64) (clientv3.LeaseID, error)
keep alive once with key
func (*Cli) KeepAliveOnce ¶
keep alive once with key
func (*Cli) PutWithNotExist ¶
put not exist key
func (*Cli) WatchWithPrefix ¶
func (cli *Cli) WatchWithPrefix(ctx context.Context, prefix string) *WatchKeyResponse
watch with prefix
type KeyChangeEvent ¶
type WatchKeyResponse ¶
type WatchKeyResponse struct { Watcher clientv3.Watcher Id clientv3.LeaseID Event <-chan *KeyChangeEvent }
Click to show internal directories.
Click to hide internal directories.