etcdutil

package
v0.0.0-...-1338f1b Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: Apache-2.0 Imports: 11 Imported by: 5

Documentation

Index

Constants

View Source
const (
	// DefaultDialTimeout is the maximum amount of time a dial will wait for a
	// connection to setup. 30s is long enough for most of the network conditions.
	DefaultDialTimeout = 30 * time.Second

	// DefaultRequestTimeout 10s is long enough for most of etcd clusters.
	DefaultRequestTimeout = 10 * time.Second

	// DefaultSlowRequestTime 1s for the threshold for normal request, for those
	// longer then 1s, they are considered as slow requests.
	DefaultSlowRequestTime = 1 * time.Second
)

Variables

This section is empty.

Functions

func CheckClusterID

func CheckClusterID(localClusterID types.ID, um types.URLsMap, tlsConfig *tls.Config) error

CheckClusterID checks Etcd's cluster ID, returns an error if mismatch. This function will never block even quorum is not satisfied.

func EtcdKVGet

func EtcdKVGet(c *clientv3.Client, key string, opts ...clientv3.OpOption) (*clientv3.GetResponse, error)

EtcdKVGet returns the etcd GetResponse by given key or key prefix

func GetProtoMsgWithModRev

func GetProtoMsgWithModRev(c *clientv3.Client, key string, msg proto.Message, opts ...clientv3.OpOption) (bool, int64, error)

GetProtoMsgWithModRev returns boolean to indicate whether the key exists or not.

func GetValue

func GetValue(c *clientv3.Client, key string, opts ...clientv3.OpOption) ([]byte, error)

GetValue gets value with key from etcd.

func ListEtcdMembers

func ListEtcdMembers(client *clientv3.Client) (*clientv3.MemberListResponse, error)

ListEtcdMembers returns a list of internal etcd members.

Types

This section is empty.

Jump to

Keyboard shortcuts

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