store

package
v0.0.0-...-a3a5c94 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

ErrKeyExists

Functions

func IsValidAsKeyPath

func IsValidAsKeyPath(s string) bool

IsValidAsKeyPath

func NewClient

func NewClient(ctx context.Context, cfg *conf.Conf, etcdClientArgs *etcdutil.ClientArgs) (err error)

NewClient

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

func (*Client) DelRunnable

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

DelRunnable

func (*Client) Delete

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

Delete v3 etcd

func (*Client) Get

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

Get

func (*Client) GetLock

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

GetLock

func (*Client) Grant

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

Grant etcd v3

func (*Client) IsRunnable

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

IsRunnable

func (*Client) KeepAliveOnce

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

KeepAliveOnce etcd v3

func (*Client) NewRunnable

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

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

func (*Client) PutWithModRev

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

PutWithModRev

func (*Client) Watch

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

Watch etcd v3

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