etcd

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2013 License: Apache-2.0, Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HTTP = iota
	HTTPS
)

Variables

This section is empty.

Functions

func CloseDebug

func CloseDebug()

func OpenDebug

func OpenDebug()

Types

type Client

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

func NewClient

func NewClient() *Client

Setup a basic conf and cluster

func (*Client) Delete

func (c *Client) Delete(key string) (*store.Response, error)

func (*Client) Get

func (c *Client) Get(key string) ([]*store.Response, error)

func (*Client) GetFrom

func (c *Client) GetFrom(key string, addr string) ([]*store.Response, error)

GetTo gets the value of the key from a given machine address. If the given machine is not available it returns an error. Mainly use for testing purpose

func (*Client) Set

func (c *Client) Set(key string, value string, ttl uint64) (*store.Response, error)

func (*Client) SetCertAndKey

func (c *Client) SetCertAndKey(cert string, key string) (bool, error)

func (*Client) SetCluster

func (c *Client) SetCluster(machines []string) bool

Try to sync from the given machine

func (*Client) SetScheme

func (c *Client) SetScheme(scheme int) (bool, error)

func (*Client) SetTo

func (c *Client) SetTo(key string, value string, ttl uint64, addr string) (*store.Response, error)

SetTo sets the value of the key to a given machine address. If the given machine is not available or is not leader it returns an error Mainly use for testing purpose.

func (*Client) SyncCluster

func (c *Client) SyncCluster() bool

sycn cluster information using the existing machine list

func (*Client) TestAndSet

func (c *Client) TestAndSet(key string, prevValue string, value string, ttl uint64) (*store.Response, bool, error)

func (*Client) Watch

func (c *Client) Watch(prefix string, sinceIndex uint64, receiver chan *store.Response, stop chan bool) (*store.Response, error)

type Cluster

type Cluster struct {
	Leader   string
	Machines []string
}

type Config

type Config struct {
	CertFile string
	KeyFile  string
	Scheme   string
	Timeout  time.Duration
}

type EtcdError

type EtcdError struct {
	ErrorCode int    `json:"errorCode"`
	Message   string `json:"message"`
	Cause     string `json:"cause,omitempty"`
}

func (EtcdError) Error

func (e EtcdError) Error() string

Jump to

Keyboard shortcuts

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