etcd

package
v0.0.0-...-9564688 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 29, 2019 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client etcd client.

func New

func New(addr ...string) (*Client, error)

New new etcd client.

func (*Client) CAS

func (e *Client) CAS(cmpKey, cmpValue, key, value string) error

CAS put value to etcd.

func (*Client) Close

func (e *Client) Close()

Close 关闭客户端

func (*Client) Get

func (e *Client) Get(key string) (string, error)

Get get value from etcd.

func (*Client) Keepalive

func (e *Client) Keepalive(key, val string) (clientv3.Lease, error)

Keepalive 创建并保活一个key.

func (*Client) List

func (e *Client) List(prefix string) (map[string]string, error)

List get keys from etcd.

func (*Client) Put

func (e *Client) Put(key, val string) error

Put 写.

func (*Client) WatchPrefix

func (e *Client) WatchPrefix(key string, ec chan clientv3.Event)

WatchPrefix 监控指定前缀.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL