package client
import "github.com/coreos/etcd/client"
Index ¶
- Variables
- type CancelableTransport
- type HTTPAction
- type HTTPClient
- type KeysAPI
- type MembersAPI
- type Node
- type Nodes
- type Response
- type SyncableHTTPClient
- type Watcher
Variables ¶
var ( ErrTimeout = context.DeadlineExceeded ErrCanceled = context.Canceled ErrNoEndpoints = errors.New("no endpoints available") ErrTooManyRedirects = errors.New("too many redirects") DefaultRequestTimeout = 5 * time.Second DefaultMaxRedirects = 10 )
var ( errors.New("client: no available etcd endpoints") ErrNoLeader = errors.New("client: no leader") ErrKeyNoExist = errors.New("client: key does not exist") ErrKeyExists = errors.New("client: key already exists") )=
var (
DefaultV2KeysPrefix = "/v2/keys"
)
var (
DefaultV2MembersPrefix = "/v2/members"
)
Types ¶
type CancelableTransport ¶
type CancelableTransport interface { http.RoundTripper CancelRequest(req *http.Request) }
CancelableTransport mimics http.Transport to provide an interface which can be substituted for testing (since the RoundTripper interface alone does not require the CancelRequest method)
type HTTPAction ¶
type HTTPClient ¶
type KeysAPI ¶
type KeysAPI interface { Create(ctx context.Context, key, value string, ttl time.Duration) (*Response, error) Get(ctx context.Context, key string) (*Response, error) Watch(key string, idx uint64) Watcher RecursiveWatch(key string, idx uint64) Watcher }
func NewDiscoveryKeysAPI ¶
func NewDiscoveryKeysAPI(c HTTPClient) KeysAPI
func NewKeysAPI ¶
func NewKeysAPI(c HTTPClient) KeysAPI
type MembersAPI ¶
type MembersAPI interface { List(ctx context.Context) ([]httptypes.Member, error) Add(ctx context.Context, peerURL string) (*httptypes.Member, error) Remove(ctx context.Context, mID string) error }
func NewMembersAPI ¶
func NewMembersAPI(c HTTPClient) MembersAPI
type Node ¶
type Node struct { Key string `json:"key"` Value string `json:"value"` Nodes Nodes `json:"nodes"` ModifiedIndex uint64 `json:"modifiedIndex"` CreatedIndex uint64 `json:"createdIndex"` }
func (*Node) String ¶
type Nodes ¶
type Nodes []*Node
type Response ¶
type Response struct { Action string `json:"action"` Node *Node `json:"node"` PrevNode *Node `json:"prevNode"` }
type SyncableHTTPClient ¶
type SyncableHTTPClient interface { HTTPClient Sync(context.Context) error Endpoints() []string }
func NewHTTPClient ¶
func NewHTTPClient(tr CancelableTransport, eps []string) (SyncableHTTPClient, error)
type Watcher ¶
Source Files ¶
- Version
- v0.5.0-alpha.4
- Published
- Nov 26, 2014
- Platform
- windows/amd64
- Imports
- 14 packages
- Last checked
- 6 minutes ago –
Tools for package owners.