Help us shape the future of Go! Take the 2026 Go Developer Survey

etcd

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2017 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Actions about watcher.
	WatchActionCreate string = "create"
	WatchActionSet    string = "set"
	WatchActionDelete string = "delete"
)

Variables

This section is empty.

Functions

func Init

func Init(endpoints []string)

Init initializes a client, connected to etcd server.

Types

type Client

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

Client is the type for etcd client.

func GetClient

func GetClient() *Client

GetClient gets a etcd client.

func (*Client) CreateDir

func (ec *Client) CreateDir(dir string) error

CreateDir creates a dir in etcd server.

func (*Client) CreateWatcher

func (ec *Client) CreateWatcher(dir string) (client.Watcher, error)

CreateWatcher creates a watcher to watch a dir.

func (*Client) Delete

func (ec *Client) Delete(key string) (err error)

Delete deletes a key.

func (*Client) Get

func (ec *Client) Get(key string) (value string, err error)

Get gets value from key in etcd server.

func (*Client) IsDirExist

func (ec *Client) IsDirExist(dir string) bool

IsDirExist gets if the path is a dir in etcd server.

func (*Client) List

func (ec *Client) List(dir string) ([]string, error)

List lists keys in a dir.

func (*Client) Set

func (ec *Client) Set(key, value string) error

Set sets value to key in etcd server.

Jump to

Keyboard shortcuts

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