etcd

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2022 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewProvider

func NewProvider(ctx context.Context, endPoints []string, username, password string) (backend.Provider, error)

Types

type Etcd

type Etcd struct {
	*clientv3.Client
	// contains filtered or unexported fields
}

func (*Etcd) Close

func (p *Etcd) Close() error

Close the provider connection.

func (*Etcd) Delete

func (p *Etcd) Delete(key string, dir bool) error

Delete the specified key or directory.

func (*Etcd) Get

func (p *Etcd) Get(key string, dir bool) (backend.KVPairs, error)

Get the value of the specified key or directory.

func (*Etcd) Incr

func (p *Etcd) Incr(key string) (int64, error)

Incr invokes an atomic value increase for the specified key.

func (*Etcd) KeepAlive

func (p *Etcd) KeepAlive(key, value string, ttl time.Duration) error

KeepAlive sets value and updates the ttl for the specified key.

func (*Etcd) Set

func (p *Etcd) Set(key, value string, ttl time.Duration) error

Set value for the specified key with a specified ttl.

func (*Etcd) Type

func (p *Etcd) Type() string

Type returns the provider type.

func (*Etcd) Watch

func (p *Etcd) Watch(key string, dir bool) (backend.EventChan, error)

Watch for changes of the specified key or directory.

Jump to

Keyboard shortcuts

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