Documentation ¶
Index ¶
- Constants
- type Cli
- func (cli *Cli) Campaign(ctx context.Context, id, prefix string, ttl int64) error
- func (cli *Cli) Delete(ctx context.Context, key string) error
- func (cli *Cli) Get(ctx context.Context, key string) (string, error)
- func (cli *Cli) GetWithPrefix(ctx context.Context, prefix string) ([]string, []string, error)
- func (cli *Cli) Keepalive(ctx context.Context, key, value string, ttl int64) (int64, error)
- func (cli *Cli) Leader(ctx context.Context, prefix string) (id string, err error)
- func (cli *Cli) Put(ctx context.Context, key, value string) error
- func (cli *Cli) PutWithNotExist(ctx context.Context, key, value string) error
- func (cli *Cli) PutWithNotExistTTL(ctx context.Context, key, value string, ttl int64) (int64, error)
- func (cli *Cli) PutWithTTL(ctx context.Context, key, value string, ttl int64) (int64, error)
- func (cli *Cli) Revoke(ctx context.Context, leaseId int64) error
- func (cli *Cli) Transfer(ctx context.Context, from, to string, value string) error
- func (cli *Cli) Watch(key string) *WatchKeyResponse
- func (cli *Cli) WatchWithPrefix(prefix string) *WatchKeyResponse
- type CliConfig
- type KeyChange
- type KeyChangeChan
- type KeyChangeEvent
- type WatchKeyResponse
Constants ¶
View Source
const ( KeyCreateChangeEvent = iota + 1 // create event KeyUpdateChangeEvent // update event KeyDeleteChangeEvent // delete event KeyCancelChangeEvent // cancel event )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cli ¶
etcd cli
func (*Cli) GetWithPrefix ¶
get with prefix
func (*Cli) PutWithNotExist ¶
func (*Cli) PutWithNotExistTTL ¶
func (*Cli) PutWithTTL ¶
put a key with ttl
func (*Cli) Watch ¶
func (cli *Cli) Watch(key string) *WatchKeyResponse
func (*Cli) WatchWithPrefix ¶
func (cli *Cli) WatchWithPrefix(prefix string) *WatchKeyResponse
type CliConfig ¶
type CliConfig struct { Endpoints []string UserName string Password string DialTimeout time.Duration }
etcd cli config
type KeyChange ¶
type KeyChange struct { Event KeyChangeEvent Key string Value string }
type KeyChangeChan ¶
type KeyChangeChan <-chan *KeyChange
type KeyChangeEvent ¶
type KeyChangeEvent int32
type WatchKeyResponse ¶
Click to show internal directories.
Click to hide internal directories.