kv

package
v0.0.0-...-0b82c43 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2016 License: Apache-2.0 Imports: 11 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KVClient

type KVClient interface {
	// Put sets the value of a key
	Put(key, value string) error

	// Get returns the value of the specified key.
	Get(key string) (string, error)

	// PutInt accepts an Int value and store it under the specified key.
	PutInt(key string, value int) error

	// GetInt returns the value of the specified key. In Int type
	GetInt(key string) (int, error)

	// GetDir returns the child nodes of a given directory
	GetDir(key string) ([]*KVPair, error)

	// PutDir creates a directory.
	PutDir(key string) error

	// PutIntDir creates an integer directory under the given key
	PutIntDir(key string, value int) error

	// DeleteTree removes a reange of keys under the given directory.
	DeleteTree(key string) error
}

func NewEtcdClient

func NewEtcdClient(cacert, cert, key string, addresses ...string) (KVClient, error)

NewKVClient instantiates and establish connection to etcd

type KVPair

type KVPair struct {
	Key       string
	Value     []byte
	LastIndex uint64
}

KVPair defines the retrieved key and value

Jump to

Keyboard shortcuts

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