etcdkv

package
v0.0.0-...-fa598ba Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FakeKey   = "/fake-key"
	FakeValue = "/fake-value"
)

Defines fake key/value pair which is used in aliveness check or epoch generation

Variables

This section is empty.

Functions

func CloseEmbededEtcd

func CloseEmbededEtcd(svr *embed.Etcd)

CloseEmbededEtcd close the input embedded etcd server

func NewClientConnImpl

func NewClientConnImpl(storeConf *metaModel.StoreConfig) (*clientConnImpl, error)

NewClientConnImpl return a new clientConnImpl

func NewEtcdClient

func NewEtcdClient(storeConf *metaModel.StoreConfig) (*clientv3.Client, error)

NewEtcdClient new a clientv3.Client.For easy test usage

func NewEtcdKVClientImpl

func NewEtcdKVClientImpl(cli *clientv3.Client) (*etcdKVClientImpl, error)

NewEtcdKVClientImpl creates a new etcdKVClientImpl instance

func RetryMockBackendEtcd

func RetryMockBackendEtcd() (s *embed.Etcd, addr string, err error)

RetryMockBackendEtcd retry to create backend DB if meet 'address already in use' error for at most 3 times.

Types

type ClientBuilderImpl

type ClientBuilderImpl struct{}

ClientBuilderImpl is the etcd kvclient builder

func (*ClientBuilderImpl) ClientType

func (b *ClientBuilderImpl) ClientType() metaModel.ClientType

ClientType implements ClientType of clientBuilder

func (*ClientBuilderImpl) NewKVClientWithNamespace

func (b *ClientBuilderImpl) NewKVClientWithNamespace(cc metaModel.ClientConn,
	projectID metaModel.ProjectID, jobID metaModel.JobID,
) (metaModel.KVClient, error)

NewKVClientWithNamespace implements NewKVClientWithNamespace of clientBuilder

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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