Versions in this module Expand all Collapse all v0 v0.1.2 May 11, 2015 v0.1.1 May 2, 2015 v0.1.0 Apr 28, 2015 Changes in this version + const ACLClientType + const ACLManagementType + const DefaultLockRetryTime + const DefaultLockSessionName + const DefaultLockSessionTTL + const DefaultLockWaitTime + const DefaultSemaphoreKey + const DefaultSemaphoreRetryTime + const DefaultSemaphoreSessionName + const DefaultSemaphoreSessionTTL + const DefaultSemaphoreWaitTime + const LockFlagValue + const SemaphoreFlagValue + const SessionBehaviorDelete + const SessionBehaviorRelease + var ErrLockConflict = fmt.Errorf("Existing key does not match lock use") + var ErrLockHeld = fmt.Errorf("Lock already held") + var ErrLockInUse = fmt.Errorf("Lock in use") + var ErrLockNotHeld = fmt.Errorf("Lock not held") + var ErrSemaphoreConflict = fmt.Errorf("Existing key does not match semaphore use") + var ErrSemaphoreHeld = fmt.Errorf("Semaphore already held") + var ErrSemaphoreInUse = fmt.Errorf("Semaphore in use") + var ErrSemaphoreNotHeld = fmt.Errorf("Semaphore not held") + type ACL struct + func (a *ACL) Clone(id string, q *WriteOptions) (string, *WriteMeta, error) + func (a *ACL) Create(acl *ACLEntry, q *WriteOptions) (string, *WriteMeta, error) + func (a *ACL) Destroy(id string, q *WriteOptions) (*WriteMeta, error) + func (a *ACL) Info(id string, q *QueryOptions) (*ACLEntry, *QueryMeta, error) + func (a *ACL) List(q *QueryOptions) ([]*ACLEntry, *QueryMeta, error) + func (a *ACL) Update(acl *ACLEntry, q *WriteOptions) (*WriteMeta, error) + type ACLEntry struct + CreateIndex uint64 + ID string + ModifyIndex uint64 + Name string + Rules string + Type string + type Agent struct + func (a *Agent) CheckDeregister(checkID string) error + func (a *Agent) CheckRegister(check *AgentCheckRegistration) error + func (a *Agent) Checks() (map[string]*AgentCheck, error) + func (a *Agent) DisableNodeMaintenance() error + func (a *Agent) DisableServiceMaintenance(serviceID string) error + func (a *Agent) EnableNodeMaintenance(reason string) error + func (a *Agent) EnableServiceMaintenance(serviceID, reason string) error + func (a *Agent) FailTTL(checkID, note string) error + func (a *Agent) ForceLeave(node string) error + func (a *Agent) Join(addr string, wan bool) error + func (a *Agent) Members(wan bool) ([]*AgentMember, error) + func (a *Agent) NodeName() (string, error) + func (a *Agent) PassTTL(checkID, note string) error + func (a *Agent) Self() (map[string]map[string]interface{}, error) + func (a *Agent) ServiceDeregister(serviceID string) error + func (a *Agent) ServiceRegister(service *AgentServiceRegistration) error + func (a *Agent) Services() (map[string]*AgentService, error) + func (a *Agent) UpdateTTL(checkID, note, status string) error + func (a *Agent) WarnTTL(checkID, note string) error + type AgentCheck struct + CheckID string + Name string + Node string + Notes string + Output string + ServiceID string + ServiceName string + Status string + type AgentCheckRegistration struct + ID string + Name string + Notes string + ServiceID string + type AgentMember struct + Addr string + DelegateCur uint8 + DelegateMax uint8 + DelegateMin uint8 + Name string + Port uint16 + ProtocolCur uint8 + ProtocolMax uint8 + ProtocolMin uint8 + Status int + Tags map[string]string + type AgentService struct + Address string + ID string + Port int + Service string + Tags []string + type AgentServiceCheck struct + HTTP string + Interval string + Script string + TTL string + Timeout string + type AgentServiceChecks []*AgentServiceCheck + type AgentServiceRegistration struct + Address string + Check *AgentServiceCheck + Checks AgentServiceChecks + ID string + Name string + Port int + Tags []string + type Catalog struct + func (c *Catalog) Datacenters() ([]string, error) + func (c *Catalog) Deregister(dereg *CatalogDeregistration, q *WriteOptions) (*WriteMeta, error) + func (c *Catalog) Node(node string, q *QueryOptions) (*CatalogNode, *QueryMeta, error) + func (c *Catalog) Nodes(q *QueryOptions) ([]*Node, *QueryMeta, error) + func (c *Catalog) Register(reg *CatalogRegistration, q *WriteOptions) (*WriteMeta, error) + func (c *Catalog) Service(service, tag string, q *QueryOptions) ([]*CatalogService, *QueryMeta, error) + func (c *Catalog) Services(q *QueryOptions) (map[string][]string, *QueryMeta, error) + type CatalogDeregistration struct + Address string + CheckID string + Datacenter string + Node string + ServiceID string + type CatalogNode struct + Node *Node + Services map[string]*AgentService + type CatalogRegistration struct + Address string + Check *AgentCheck + Datacenter string + Node string + Service *AgentService + type CatalogService struct + Address string + Node string + ServiceAddress string + ServiceID string + ServiceName string + ServicePort int + ServiceTags []string + type Client struct + func NewClient(config *Config) (*Client, error) + func (c *Client) ACL() *ACL + func (c *Client) Agent() *Agent + func (c *Client) Catalog() *Catalog + func (c *Client) Event() *Event + func (c *Client) Health() *Health + func (c *Client) KV() *KV + func (c *Client) LockKey(key string) (*Lock, error) + func (c *Client) LockOpts(opts *LockOptions) (*Lock, error) + func (c *Client) Raw() *Raw + func (c *Client) SemaphoreOpts(opts *SemaphoreOptions) (*Semaphore, error) + func (c *Client) SemaphorePrefix(prefix string, limit int) (*Semaphore, error) + func (c *Client) Session() *Session + func (c *Client) Status() *Status + type Config struct + Address string + Datacenter string + HttpAuth *HttpBasicAuth + HttpClient *http.Client + Scheme string + Token string + WaitTime time.Duration + func DefaultConfig() *Config + type Event struct + func (e *Event) Fire(params *UserEvent, q *WriteOptions) (string, *WriteMeta, error) + func (e *Event) IDToIndex(uuid string) uint64 + func (e *Event) List(name string, q *QueryOptions) ([]*UserEvent, *QueryMeta, error) + type Health struct + func (h *Health) Checks(service string, q *QueryOptions) ([]*HealthCheck, *QueryMeta, error) + func (h *Health) Node(node string, q *QueryOptions) ([]*HealthCheck, *QueryMeta, error) + func (h *Health) Service(service, tag string, passingOnly bool, q *QueryOptions) ([]*ServiceEntry, *QueryMeta, error) + func (h *Health) State(state string, q *QueryOptions) ([]*HealthCheck, *QueryMeta, error) + type HealthCheck struct + CheckID string + Name string + Node string + Notes string + Output string + ServiceID string + ServiceName string + Status string + type HttpBasicAuth struct + Password string + Username string + type KV struct + func (k *KV) Acquire(p *KVPair, q *WriteOptions) (bool, *WriteMeta, error) + func (k *KV) CAS(p *KVPair, q *WriteOptions) (bool, *WriteMeta, error) + func (k *KV) Delete(key string, w *WriteOptions) (*WriteMeta, error) + func (k *KV) DeleteCAS(p *KVPair, q *WriteOptions) (bool, *WriteMeta, error) + func (k *KV) DeleteTree(prefix string, w *WriteOptions) (*WriteMeta, error) + func (k *KV) Get(key string, q *QueryOptions) (*KVPair, *QueryMeta, error) + func (k *KV) Keys(prefix, separator string, q *QueryOptions) ([]string, *QueryMeta, error) + func (k *KV) List(prefix string, q *QueryOptions) (KVPairs, *QueryMeta, error) + func (k *KV) Put(p *KVPair, q *WriteOptions) (*WriteMeta, error) + func (k *KV) Release(p *KVPair, q *WriteOptions) (bool, *WriteMeta, error) + type KVPair struct + CreateIndex uint64 + Flags uint64 + Key string + LockIndex uint64 + ModifyIndex uint64 + Session string + Value []byte + type KVPairs []*KVPair + type Lock struct + func (l *Lock) Destroy() error + func (l *Lock) Lock(stopCh <-chan struct{}) (<-chan struct{}, error) + func (l *Lock) Unlock() error + type LockOptions struct + Key string + Session string + SessionName string + SessionTTL string + Value []byte + type Node struct + Address string + Node string + type QueryMeta struct + KnownLeader bool + LastContact time.Duration + LastIndex uint64 + RequestTime time.Duration + type QueryOptions struct + AllowStale bool + Datacenter string + RequireConsistent bool + Token string + WaitIndex uint64 + WaitTime time.Duration + type Raw struct + func (raw *Raw) Query(endpoint string, out interface{}, q *QueryOptions) (*QueryMeta, error) + func (raw *Raw) Write(endpoint string, in, out interface{}, q *WriteOptions) (*WriteMeta, error) + type Semaphore struct + func (s *Semaphore) Acquire(stopCh <-chan struct{}) (<-chan struct{}, error) + func (s *Semaphore) Destroy() error + func (s *Semaphore) Release() error + type SemaphoreOptions struct + Limit int + Prefix string + Session string + SessionName string + SessionTTL string + Value []byte + type ServiceEntry struct + Checks []*HealthCheck + Node *Node + Service *AgentService + type Session struct + func (s *Session) Create(se *SessionEntry, q *WriteOptions) (string, *WriteMeta, error) + func (s *Session) CreateNoChecks(se *SessionEntry, q *WriteOptions) (string, *WriteMeta, error) + func (s *Session) Destroy(id string, q *WriteOptions) (*WriteMeta, error) + func (s *Session) Info(id string, q *QueryOptions) (*SessionEntry, *QueryMeta, error) + func (s *Session) List(q *QueryOptions) ([]*SessionEntry, *QueryMeta, error) + func (s *Session) Node(node string, q *QueryOptions) ([]*SessionEntry, *QueryMeta, error) + func (s *Session) Renew(id string, q *WriteOptions) (*SessionEntry, *WriteMeta, error) + func (s *Session) RenewPeriodic(initialTTL string, id string, q *WriteOptions, doneCh chan struct{}) error + type SessionEntry struct + Behavior string + Checks []string + CreateIndex uint64 + ID string + LockDelay time.Duration + Name string + Node string + TTL string + type Status struct + func (s *Status) Leader() (string, error) + func (s *Status) Peers() ([]string, error) + type UserEvent struct + ID string + LTime uint64 + Name string + NodeFilter string + Payload []byte + ServiceFilter string + TagFilter string + Version int + type WriteMeta struct + RequestTime time.Duration + type WriteOptions struct + Datacenter string + Token string