etcd

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2021 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EtcdEventTypeUpdate = "update"
	EtcdEventTypeCreate = "create"
	EtcdEventTypeDelete = "delete"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EtcdEvent

type EtcdEvent struct {
	ID     string             `json:"-"`
	Type   string             `json:"type"`
	More   bool               `json:"more"`
	Header *pb.ResponseHeader `json:"header"`
	Kvs    []*mvccpb.KeyValue `json:"kvs"`
	PrevKv *mvccpb.KeyValue   `json:"prev_kv,omitempty"`
}

type EtcdStorage

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

func NewEtcdStorage

func NewEtcdStorage(id, watchPrefix string, client *clientv3.Client) *EtcdStorage

func (*EtcdStorage) Close

func (etcd *EtcdStorage) Close()

func (*EtcdStorage) Create

func (etcd *EtcdStorage) Create(key, val string, lease int64) (*clientv3.PutResponse, error)

func (*EtcdStorage) Delete

func (etcd *EtcdStorage) Delete(key string, withprefix bool) error

func (*EtcdStorage) GetRevision

func (etcd *EtcdStorage) GetRevision(key string) (int64, error)

func (*EtcdStorage) Query

func (etcd *EtcdStorage) Query(key string, withprefix bool, endkey string, limit int64, revision *int64) (*clientv3.GetResponse, error)

func (*EtcdStorage) SetWatchPrefix

func (etcd *EtcdStorage) SetWatchPrefix(watchPrefix string)

func (*EtcdStorage) Watch

func (etcd *EtcdStorage) Watch(revision int64, key string, c chan *EtcdEvent)

func (*EtcdStorage) WatchClose

func (etcd *EtcdStorage) WatchClose()

func (*EtcdStorage) WatchPrefix

func (etcd *EtcdStorage) WatchPrefix() string

Jump to

Keyboard shortcuts

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