etcd

package
v0.0.0-...-1593278 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEmbedEtcdClient

func GetEmbedEtcdClient() (*clientv3.Client, error)

GetEmbedEtcdClient returns client of embed etcd server

func GetEmbedEtcdEndpoints

func GetEmbedEtcdEndpoints(server *embed.Etcd) []string

GetEmbedEtcdEndpoints returns etcd listener address for endpoint config.

func GetEtcdClient

func GetEtcdClient(
	useEmbedEtcd bool,
	useSSL bool,
	endpoints []string,
	certFile string,
	keyFile string,
	caCertFile string,
	minVersion string) (*clientv3.Client, error)

GetEtcdClient returns etcd client

func GetRemoteEtcdClient

func GetRemoteEtcdClient(endpoints []string) (*clientv3.Client, error)

GetRemoteEtcdClient returns client of remote etcd by given endpoints

func GetRemoteEtcdSSLClient

func GetRemoteEtcdSSLClient(endpoints []string, certFile string, keyFile string, caCertFile string, minVersion string) (*clientv3.Client, error)

func HasServer

func HasServer() bool

func InitEtcdServer

func InitEtcdServer(
	useEmbedEtcd bool,
	configPath string,
	dataDir string,
	logPath string,
	logLevel string,
) error

InitEtcdServer initializes embedded etcd server singleton.

func RemoveByBatch

func RemoveByBatch(removals []string, op func(partialKeys []string) error) error

func SaveByBatch

func SaveByBatch(kvs map[string]string, op func(partialKvs map[string]string) error) error

SaveByBatch there will not guarantee atomicity.

func SaveByBatchWithLimit

func SaveByBatchWithLimit(kvs map[string]string, limit int, op func(partialKvs map[string]string) error) error

SaveByBatchWithLimit is SaveByBatch with customized limit.

func StartTestEmbedEtcdServer

func StartTestEmbedEtcdServer() (*embed.Etcd, string, error)

StartTestEmbedEtcdServer returns a newly created embed etcd server. ### USED FOR UNIT TEST ONLY ###

func StopEtcdServer

func StopEtcdServer()

StopEtcdServer stops embedded etcd server singleton.

Types

This section is empty.

Jump to

Keyboard shortcuts

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