rainbond: github.com/goodrain/rainbond/node/core/store Index | Files

package store

import "github.com/goodrain/rainbond/node/core/store"


Package Files



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

ErrKeyExists key exist error

func IsValidAsKeyPath Uses

func IsValidAsKeyPath(s string) bool

IsValidAsKeyPath IsValidAsKeyPath

func NewClient Uses

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

NewClient 创建client

type Client Uses

type Client struct {
    // contains filtered or unexported fields

Client etcd client

var (
    //DefalutClient etcd client
    DefalutClient *Client

func (*Client) DelLock Uses

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

DelLock DelLock

func (*Client) DelRunnable Uses

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

DelRunnable DelRunnable

func (*Client) Delete Uses

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

Delete delete v3 etcd

func (*Client) Get Uses

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

Get get

func (*Client) GetLock Uses

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

GetLock GetLock

func (*Client) Grant Uses

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

Grant etcd v3 Grant

func (*Client) IsRunnable Uses

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

IsRunnable IsRunnable

func (*Client) KeepAliveOnce Uses

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

KeepAliveOnce etcd v3 KeepAliveOnce

func (*Client) NewRunnable Uses

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

NewRunnable NewRunnable

func (*Client) Post Uses

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 Uses

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

Put etcd v3 Put

func (*Client) PutWithModRev Uses

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

PutWithModRev PutWithModRev

func (*Client) Watch Uses

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

Watch etcd v3 watch

func (*Client) WatchByCtx Uses

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

WatchByCtx watch by ctx

Package store imports 8 packages (graph) and is imported by 7 packages. Updated 2019-09-20. Refresh now. Tools for package owners.