etcdclient

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2020 License: Apache-2.0 Imports: 7 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrClosedEtcdClient = errors.New("use of closed etcd client")

ErrClosedEtcdClient means etcd client closed

Functions

This section is empty.

Types

type EtcdClient

type EtcdClient struct {
	sync.Mutex

	Prefix string
	// contains filtered or unexported fields
}

EtcdClient etcd client

func New

func New(addr string, timeout time.Duration, username, passwd, root string) (*EtcdClient, error)

New constructor of EtcdClient

func (*EtcdClient) BasePrefix

func (c *EtcdClient) BasePrefix() string

BasePrefix return base prefix

func (*EtcdClient) Close

func (c *EtcdClient) Close() error

Close close etcd client

func (*EtcdClient) Create

func (c *EtcdClient) Create(path string, data []byte) error

Create create path with data

func (*EtcdClient) Delete

func (c *EtcdClient) Delete(path string) error

Delete delete path

func (*EtcdClient) List

func (c *EtcdClient) List(path string) ([]string, error)

List list path, return slice of all paths

func (*EtcdClient) Mkdir

func (c *EtcdClient) Mkdir(dir string) error

Mkdir create directory

func (*EtcdClient) Read

func (c *EtcdClient) Read(path string) ([]byte, error)

Read read path data

func (*EtcdClient) Update

func (c *EtcdClient) Update(path string, data []byte) error

Update update path with data

func (*EtcdClient) UpdateWithTTL

func (c *EtcdClient) UpdateWithTTL(path string, data []byte, ttl time.Duration) error

UpdateWithTTL update path with data and ttl

func (*EtcdClient) Watch

func (c *EtcdClient) Watch(path string, ch chan string) error

Watch watch path

Jump to

Keyboard shortcuts

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