etcd

package
v0.0.0-...-6091764 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Etcd

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

func NewClient

func NewClient(endpoints []string, timeout, kaTime, kaTimeout time.Duration) *Etcd

Creates a new etcd client with the specified configuration.

func (*Etcd) Create

func (e *Etcd) Create(key, value string) error

Inserts a new key/value pair. This will not overwrite an already existing key.

func (*Etcd) CreateWithLease

func (e *Etcd) CreateWithLease(key, value string, ttl int64) (int64, error)

Creates a key with a specified TTL. This will not overwrite an already existing key.

func (*Etcd) Delete

func (e *Etcd) Delete(key string) error

Deletes a key/value pair.

func (*Etcd) Read

func (e *Etcd) Read(key string) (string, error)

Reads a key's value.

func (*Etcd) ReadAll

func (e *Etcd) ReadAll(key string) (map[string]string, error)

Read all key/values under a specified key.

func (*Etcd) RefreshLease

func (e *Etcd) RefreshLease(id int64) error

Refreshes a lease once.

func (*Etcd) Update

func (e *Etcd) Update(key, value string) error

Updates a key's value. This will overwrite an existing key if present.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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