etcd

package
v0.0.0-...-7253f33 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EtcdClient

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

EtcdClient represents the etcd client wrapper.

func NewEtcdClient

func NewEtcdClient(endpoints []string, dialTimeout time.Duration) (*EtcdClient, error)

NewEtcdClient creates a new etcd client.

func (*EtcdClient) Close

func (ec *EtcdClient) Close() error

Close closes the etcd client connection.

func (*EtcdClient) Delete

func (ec *EtcdClient) Delete(ctx context.Context, key string) (*clientv3.DeleteResponse, error)

Delete deletes a key from etcd.

func (*EtcdClient) Get

func (ec *EtcdClient) Get(ctx context.Context, key string) (*clientv3.GetResponse, error)

Get gets the value for a given key from etcd.

func (*EtcdClient) Put

func (ec *EtcdClient) Put(ctx context.Context, key, value string) (*clientv3.PutResponse, error)

Put puts a key-value pair into etcd.

Jump to

Keyboard shortcuts

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