etcd

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2021 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 value of the specified key or directory

func (*Etcd) Incr

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

Atomic increase the specified key

func (*Etcd) KeepAlive

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

Set and update ttl for the specified key

func (*Etcd) Set

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

Set value with the specified key

func (*Etcd) Type

func (p *Etcd) Type() string

Return provider type

func (*Etcd) Watch

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

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