store

package
v3.4.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2018 License: LGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrKeyExists = errors.New("key already exists")

ErrKeyExists key exist error

Functions

func IsValidAsKeyPath

func IsValidAsKeyPath(s string) bool

IsValidAsKeyPath IsValidAsKeyPath

func NewClient

func NewClient(cfg *conf.Conf) (err error)

NewClient 创建client

Types

type Client

type Client struct {
	*client.Client
	// contains filtered or unexported fields
}

Client etcd client

var (
	//DefalutClient etcd client
	DefalutClient *Client
)

func (*Client) DelLock

func (c *Client) DelLock(key string) error

DelLock DelLock

func (*Client) DelRunnable

func (c *Client) DelRunnable(key string, opts ...client.OpOption) (*client.DeleteResponse, error)

DelRunnable DelRunnable

func (*Client) Delete

func (c *Client) Delete(key string, opts ...client.OpOption) (*client.DeleteResponse, error)

Delete delete v3 etcd

func (*Client) Get

func (c *Client) Get(key string, opts ...client.OpOption) (*client.GetResponse, error)

Get get

func (*Client) GetLock

func (c *Client) GetLock(key string, id client.LeaseID) (bool, error)

GetLock GetLock

func (*Client) Grant

func (c *Client) Grant(ttl int64) (*client.LeaseGrantResponse, error)

Grant etcd v3 Grant

func (*Client) IsRunnable

func (c *Client) IsRunnable(key string, opts ...client.OpOption) bool

IsRunnable IsRunnable

func (*Client) KeepAliveOnce

func (c *Client) KeepAliveOnce(id client.LeaseID) (*client.LeaseKeepAliveResponse, error)

KeepAliveOnce etcd v3 KeepAliveOnce

func (*Client) NewRunnable

func (c *Client) NewRunnable(key, val string, opts ...client.OpOption) (*client.PutResponse, error)

NewRunnable NewRunnable

func (*Client) Post

func (c *Client) Post(key, val string, opts ...client.OpOption) (*client.PutResponse, error)

Post attempts to create the given key, only succeeding if the key did not yet exist.

func (*Client) Put

func (c *Client) Put(key, val string, opts ...client.OpOption) (*client.PutResponse, error)

Put etcd v3 Put

func (*Client) PutWithModRev

func (c *Client) PutWithModRev(key, val string, rev int64) (*client.PutResponse, error)

PutWithModRev PutWithModRev

func (*Client) Watch

func (c *Client) Watch(key string, opts ...client.OpOption) client.WatchChan

Watch etcd v3 watch

func (*Client) WatchByCtx

func (c *Client) WatchByCtx(ctx context.Context, key string, opts ...client.OpOption) client.WatchChan

WatchByCtx watch by ctx

Jump to

Keyboard shortcuts

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