meta

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2026 License: MIT Imports: 19 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ETCD

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

ETCD is the etcd backed meta store.

func NewETCD

func NewETCD(ctx context.Context, config types.EtcdConfig, embeddedETCD *embedded.Cluster) (*ETCD, error)

func (*ETCD) BatchCreate

func (e *ETCD) BatchCreate(ctx context.Context, data map[string]string) (*clientv3.TxnResponse, error)

func (*ETCD) BatchCreateAndDecr

func (e *ETCD) BatchCreateAndDecr(ctx context.Context, data map[string]string, decrKey string) (err error)

func (*ETCD) BatchDelete

func (e *ETCD) BatchDelete(ctx context.Context, keys []string) (*clientv3.TxnResponse, error)

func (*ETCD) BatchPut

func (e *ETCD) BatchPut(ctx context.Context, data map[string]string) (*clientv3.TxnResponse, error)

func (*ETCD) BatchUpdate

func (e *ETCD) BatchUpdate(ctx context.Context, data map[string]string) (*clientv3.TxnResponse, error)

func (*ETCD) BindStatus

func (e *ETCD) BindStatus(ctx context.Context, entityKey, statusKey, statusValue string, ttl int64) error

func (*ETCD) Create

func (e *ETCD) Create(ctx context.Context, key, val string) (*clientv3.TxnResponse, error)

func (*ETCD) CreateLock

func (e *ETCD) CreateLock(key string, ttl time.Duration) (lock.DistributedLock, error)

func (*ETCD) Delete

func (e *ETCD) Delete(ctx context.Context, key string) (*clientv3.DeleteResponse, error)

func (*ETCD) Get

func (e *ETCD) Get(ctx context.Context, key string, opts ...clientv3.OpOption) (*clientv3.GetResponse, error)

func (*ETCD) GetMulti

func (e *ETCD) GetMulti(ctx context.Context, keys []string) ([]*mvccpb.KeyValue, error)

func (*ETCD) GetOne

func (e *ETCD) GetOne(ctx context.Context, key string, opts ...clientv3.OpOption) (*mvccpb.KeyValue, error)

func (*ETCD) Put

func (e *ETCD) Put(ctx context.Context, key, val string) (*clientv3.PutResponse, error)

func (*ETCD) StartEphemeral

func (e *ETCD) StartEphemeral(ctx context.Context, path string, heartbeat time.Duration) (<-chan struct{}, func(), error)

func (*ETCD) Watch

func (e *ETCD) Watch(ctx context.Context, key string, opts ...clientv3.OpOption) clientv3.WatchChan

type ETCDClientV3

type ETCDClientV3 interface {
	clientv3.KV
	clientv3.Lease
	clientv3.Watcher
}

ETCDClientV3 is the etcd client surface the store depends on.

type ETCDTxn

type ETCDTxn struct {
	If   []clientv3.Cmp
	Then []clientv3.Op
	Else []clientv3.Op
}

ETCDTxn wraps a group of Cmp with Op

type KV

type KV interface {
	BindStatus(ctx context.Context, entityKey, statusKey, statusValue string, ttl int64) error

	Get(ctx context.Context, key string, opts ...clientv3.OpOption) (*clientv3.GetResponse, error)
	GetOne(ctx context.Context, key string, opts ...clientv3.OpOption) (*mvccpb.KeyValue, error)
	GetMulti(ctx context.Context, keys []string) ([]*mvccpb.KeyValue, error)
	Watch(ctx context.Context, key string, opts ...clientv3.OpOption) clientv3.WatchChan

	Create(ctx context.Context, key, val string) (*clientv3.TxnResponse, error)
	Put(ctx context.Context, key, val string) (*clientv3.PutResponse, error)
	Delete(ctx context.Context, key string) (*clientv3.DeleteResponse, error)

	BatchCreateAndDecr(ctx context.Context, data map[string]string, decrKey string) error

	BatchCreate(ctx context.Context, data map[string]string) (*clientv3.TxnResponse, error)
	BatchUpdate(ctx context.Context, data map[string]string) (*clientv3.TxnResponse, error)
	BatchDelete(ctx context.Context, keys []string) (*clientv3.TxnResponse, error)
	BatchPut(ctx context.Context, data map[string]string) (*clientv3.TxnResponse, error)

	StartEphemeral(ctx context.Context, path string, heartbeat time.Duration) (<-chan struct{}, func(), error)
	CreateLock(key string, ttl time.Duration) (lock.DistributedLock, error)
}

KV is the etcd surface the store is built on.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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