Documentation
¶
Index ¶
- Constants
- Variables
- func CloseDebug()
- func OpenDebug()
- type Client
- func (c *Client) Delete(key string) (*Response, error)
- func (c *Client) Get(key string) ([]*Response, error)
- func (c *Client) GetCluster() []string
- func (c *Client) GetFrom(key string, addr string) ([]*Response, error)
- func (c *Client) Set(key string, value string, ttl uint64) (*Response, error)
- func (c *Client) SetCertAndKey(cert string, key string) (bool, error)
- func (c *Client) SetCluster(machines []string) bool
- func (c *Client) SetScheme(scheme int) (bool, error)
- func (c *Client) SetTo(key string, value string, ttl uint64, addr string) (*Response, error)
- func (c *Client) SyncCluster() bool
- func (c *Client) TestAndSet(key string, prevValue string, value string, ttl uint64) (*Response, bool, error)
- func (c *Client) Watch(prefix string, sinceIndex uint64, receiver chan *Response, stop chan bool) (*Response, error)
- type Cluster
- type Config
- type EtcdError
- type Response
Constants ¶
View Source
const ( HTTP = iota HTTPS )
Variables ¶
View Source
var (
ErrWatchStoppedByUser = errors.New("Watch stopped by the user via stop channel")
)
Errors introduced by the Watch command.
Functions ¶
func CloseDebug ¶
func CloseDebug()
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) GetCluster ¶ added in v0.2.0
func (*Client) GetFrom ¶
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) SetCertAndKey ¶
func (*Client) SetCluster ¶
Try to sync from the given machine
func (*Client) SetTo ¶
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 ¶
sycn cluster information using the existing machine list
func (*Client) TestAndSet ¶
type EtcdError ¶
type Response ¶ added in v0.2.0
type Response struct {
Action string `json:"action"`
Key string `json:"key"`
Dir bool `json:"dir,omitempty"`
PrevValue string `json:"prevValue,omitempty"`
Value string `json:"value,omitempty"`
// If the key did not exist before the action,
// this field should be set to true
NewKey bool `json:"newKey,omitempty"`
Expiration *time.Time `json:"expiration,omitempty"`
// Time to live in second
TTL int64 `json:"ttl,omitempty"`
// The command index of the raft machine when the command is executed
Index uint64 `json:"index"`
}
The response object from the server.
Click to show internal directories.
Click to hide internal directories.