etcd

package
v1.2.0-alpha.1....-bad838f Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2015 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EtcdCreate = "create"
	EtcdGet    = "get"
	EtcdSet    = "set"
	EtcdCAS    = "compareAndSwap"
	EtcdDelete = "delete"
	EtcdExpire = "expire"
)

Etcd watch event actions

Variables

This section is empty.

Functions

func EtcdHealthCheck

func EtcdHealthCheck(data []byte) error

func GetEtcdVersion

func GetEtcdVersion(host string) (string, error)

GetEtcdVersion performs a version check against the provided Etcd server, returning the string response, and error (if any).

func IsEtcdNodeExist

func IsEtcdNodeExist(err error) bool

IsEtcdNodeExist returns true if and only if err is an etcd node already exist error.

func IsEtcdNotFound

func IsEtcdNotFound(err error) bool

IsEtcdNotFound returns true if and only if err is an etcd not found error.

func IsEtcdTestFailed

func IsEtcdTestFailed(err error) bool

IsEtcdTestFailed returns true if and only if err is an etcd write conflict.

func IsEtcdWatchStoppedByUser

func IsEtcdWatchStoppedByUser(err error) bool

IsEtcdWatchStoppedByUser returns true if and only if err is a client triggered stop.

func NewEtcdClientStartServerIfNecessary

func NewEtcdClientStartServerIfNecessary(server string) (tools.EtcdClient, error)

func NewEtcdStorage

func NewEtcdStorage(client tools.EtcdClient, codec runtime.Codec, prefix string) storage.Interface

Types

type APIObjectVersioner

type APIObjectVersioner struct{}

APIObjectVersioner implements versioning and extracting etcd node information for objects that have an embedded ObjectMeta or ListMeta field.

func (APIObjectVersioner) ObjectResourceVersion

func (a APIObjectVersioner) ObjectResourceVersion(obj runtime.Object) (uint64, error)

ObjectResourceVersion implements Versioner

func (APIObjectVersioner) UpdateList

func (a APIObjectVersioner) UpdateList(obj runtime.Object, resourceVersion uint64) error

UpdateList implements Versioner

func (APIObjectVersioner) UpdateObject

func (a APIObjectVersioner) UpdateObject(obj runtime.Object, expiration *time.Time, resourceVersion uint64) error

UpdateObject implements Versioner

type EtcdTestServer

type EtcdTestServer struct {
	etcdserver.ServerConfig
	PeerListeners, ClientListeners []net.Listener
	// contains filtered or unexported fields
}

EtcdTestServer encapsulates the datastructures needed to start local instance for testing

func NewEtcdTestClientServer

func NewEtcdTestClientServer(t *testing.T) *EtcdTestServer

NewEtcdTestClientServer creates a new client and server for testing

func NewEtcdTestStorage

func NewEtcdTestStorage(t *testing.T, codec runtime.Codec, prefix string) (*EtcdTestServer, storage.Interface)

NewEtcdTestStorage creates a new storage.Interface and TestServer

func (*EtcdTestServer) Terminate

func (m *EtcdTestServer) Terminate(t *testing.T)

Terminate will shutdown the running etcd server

type TransformFunc

type TransformFunc func(runtime.Object) (runtime.Object, error)

TransformFunc attempts to convert an object to another object for use with a watcher.

Jump to

Keyboard shortcuts

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