etcdclient

package
v1.6.6 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package etcdclient implements etcd client utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Logger           *zap.Logger
	EtcdClientConfig clientv3.Config
}

Config defines etcd client config.

type Etcd

type Etcd interface {
	Put(timeout time.Duration, k, v string, leaseTTL time.Duration) error
	Get(timeout time.Duration, k string) ([]*mvccpb.KeyValue, error)
	Campaign(pfx string, timeout time.Duration) (ok bool, err error)
	List(pfx string, listBatchLimit int64, listBatchInterval time.Duration) (rs []*mvccpb.KeyValue, err error)
	Close()
}

Etcd defines etcd client operations.

func New

func New(cfg Config) (Etcd, error)

Jump to

Keyboard shortcuts

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