Versions in this module Expand all Collapse all v0 v0.1.1 Dec 26, 2014 Changes in this version + const ConsulServiceID + const ConsulServiceName + const DefaultDC + const DefaultLANSerfPort + const DefaultWANSerfPort + const ProtocolVersionMax + const ProtocolVersionMin + const SerfCheckAliveOutput + const SerfCheckFailedOutput + const SerfCheckID + const SerfCheckName + const StatusReap + var DefaultRPCAddr = &net.TCPAddr + func DefaultIndexFunc(idx *MDBIndex, parts []string) string + func DefaultIndexPrefixFunc(idx *MDBIndex, parts []string) string + func FilterDirEnt(acl acl.ACL, ent structs.DirEntries) structs.DirEntries + func FilterEntries(f Filter) int + func FilterKeys(acl acl.ACL, keys []string) []string + func GetPrivateIP() (net.IP, error) + func NewFSM(path string, logOutput io.Writer) (*consulFSM, error) + func ToLowerList(l []string) []string + type ACL struct + func (a *ACL) Apply(args *structs.ACLRequest, reply *string) error + func (a *ACL) Get(args *structs.ACLSpecificRequest, reply *structs.IndexedACLs) error + func (a *ACL) GetPolicy(args *structs.ACLPolicyRequest, reply *structs.ACLPolicy) error + func (a *ACL) List(args *structs.DCSpecificRequest, reply *structs.IndexedACLs) error + type Catalog struct + func (c *Catalog) Deregister(args *structs.DeregisterRequest, reply *struct{}) error + func (c *Catalog) ListDatacenters(args *struct{}, reply *[]string) error + func (c *Catalog) ListNodes(args *structs.DCSpecificRequest, reply *structs.IndexedNodes) error + func (c *Catalog) ListServices(args *structs.DCSpecificRequest, reply *structs.IndexedServices) error + func (c *Catalog) NodeServices(args *structs.NodeSpecificRequest, reply *structs.IndexedNodeServices) error + func (c *Catalog) Register(args *structs.RegisterRequest, reply *struct{}) error + func (c *Catalog) ServiceNodes(args *structs.ServiceSpecificRequest, reply *structs.IndexedServiceNodes) error + type Client struct + func NewClient(config *Config) (*Client, error) + func (c *Client) JoinLAN(addrs []string) (int, error) + func (c *Client) LANMembers() []serf.Member + func (c *Client) Leave() error + func (c *Client) LocalMember() serf.Member + func (c *Client) RPC(method string, args interface{}, reply interface{}) error + func (c *Client) RemoveFailedNode(node string) error + func (c *Client) Shutdown() error + func (c *Client) Stats() map[string]map[string]string + func (c *Client) UserEvent(name string, payload []byte) error + type Config struct + ACLDatacenter string + ACLDefaultPolicy string + ACLDownPolicy string + ACLMasterToken string + ACLTTL time.Duration + ACLToken string + Bootstrap bool + BootstrapExpect int + Build string + CAFile string + CertFile string + DataDir string + Datacenter string + KeyFile string + LogOutput io.Writer + NodeName string + ProtocolVersion uint8 + RPCAddr *net.TCPAddr + RPCAdvertise *net.TCPAddr + RaftConfig *raft.Config + ReconcileInterval time.Duration + RejoinAfterLeave bool + SerfLANConfig *serf.Config + SerfWANConfig *serf.Config + ServerName string + ServerUp func() + UserEventHandler func(serf.UserEvent) + VerifyIncoming bool + VerifyOutgoing bool + func DefaultConfig() *Config + func (c *Config) AppendCA(pool *x509.CertPool) error + func (c *Config) CheckACL() error + func (c *Config) CheckVersion() error + func (c *Config) IncomingTLSConfig() (*tls.Config, error) + func (c *Config) KeyPair() (*tls.Certificate, error) + func (c *Config) OutgoingTLSConfig() (*tls.Config, error) + type Conn struct + func (c *Conn) Close() error + type ConnPool struct + func NewPool(logOutput io.Writer, maxTime time.Duration, maxStreams int, ...) *ConnPool + func (p *ConnPool) RPC(addr net.Addr, version int, method string, args interface{}, reply interface{}) error + func (p *ConnPool) Shutdown() error + type Filter interface + Filter func(int) bool + Len func() int + Move func(dst, src, span int) + type Health struct + func (h *Health) ChecksInState(args *structs.ChecksInStateRequest, reply *structs.IndexedHealthChecks) error + func (h *Health) NodeChecks(args *structs.NodeSpecificRequest, reply *structs.IndexedHealthChecks) error + func (h *Health) ServiceChecks(args *structs.ServiceSpecificRequest, reply *structs.IndexedHealthChecks) error + func (h *Health) ServiceNodes(args *structs.ServiceSpecificRequest, reply *structs.IndexedCheckServiceNodes) error + type IndexFunc func(*MDBIndex, []string) string + type Interface interface + LANMembers func() []serf.Member + LocalMember func() serf.Member + RPC func(method string, args interface{}, reply interface{}) error + type Internal struct + func (m *Internal) EventFire(args *structs.EventFireRequest, reply *structs.EventFireResponse) error + func (m *Internal) NodeDump(args *structs.DCSpecificRequest, reply *structs.IndexedNodeDump) error + func (m *Internal) NodeInfo(args *structs.NodeSpecificRequest, reply *structs.IndexedNodeDump) error + type KVS struct + func (k *KVS) Apply(args *structs.KVSRequest, reply *bool) error + func (k *KVS) Get(args *structs.KeyRequest, reply *structs.IndexedDirEntries) error + func (k *KVS) List(args *structs.KeyRequest, reply *structs.IndexedDirEntries) error + func (k *KVS) ListKeys(args *structs.KeyListRequest, reply *structs.IndexedKeyList) error + type MDBIndex struct + AllowBlank bool + CaseInsensitive bool + Fields []string + IdxFunc IndexFunc + RealIndex string + Unique bool + Virtual bool + type MDBTable struct + Decoder func([]byte) interface{} + Encoder func(interface{}) []byte + Env *mdb.Env + Indexes map[string]*MDBIndex + Name string + func (t *MDBTable) Delete(index string, parts ...string) (num int, err error) + func (t *MDBTable) DeleteTxn(tx *MDBTxn, index string, parts ...string) (int, error) + func (t *MDBTable) Get(index string, parts ...string) (uint64, []interface{}, error) + func (t *MDBTable) GetTxn(tx *MDBTxn, index string, parts ...string) ([]interface{}, error) + func (t *MDBTable) Init() error + func (t *MDBTable) Insert(obj interface{}) error + func (t *MDBTable) InsertTxn(tx *MDBTxn, obj interface{}) error + func (t *MDBTable) LastIndex() (uint64, error) + func (t *MDBTable) LastIndexTxn(tx *MDBTxn) (uint64, error) + func (t *MDBTable) SetLastIndex(index uint64) error + func (t *MDBTable) SetLastIndexTxn(tx *MDBTxn, index uint64) error + func (t *MDBTable) SetMaxLastIndexTxn(tx *MDBTxn, index uint64) error + func (t *MDBTable) StartTxn(readonly bool, mdbTxn *MDBTxn) (*MDBTxn, error) + func (t *MDBTable) StreamTxn(stream chan<- interface{}, tx *MDBTxn, index string, parts ...string) error + type MDBTables []*MDBTable + func (t MDBTables) LastIndexTxn(tx *MDBTxn) (uint64, error) + func (t MDBTables) StartTxn(readonly bool) (*MDBTxn, error) + type MDBTxn struct + func (t *MDBTxn) Abort() + func (t *MDBTxn) Commit() error + func (t *MDBTxn) Defer(f func()) + type NotifyGroup struct + func (n *NotifyGroup) Notify() + func (n *NotifyGroup) Wait(ch chan struct{}) + func (n *NotifyGroup) WaitCh() chan struct{} + type RPCType byte + type RaftLayer struct + func NewRaftLayer(addr net.Addr, tlsConfig *tls.Config) *RaftLayer + func (l *RaftLayer) Accept() (net.Conn, error) + func (l *RaftLayer) Addr() net.Addr + func (l *RaftLayer) Close() error + func (l *RaftLayer) Dial(address string, timeout time.Duration) (net.Conn, error) + func (l *RaftLayer) Handoff(c net.Conn) error + type Server struct + func NewServer(config *Config) (*Server, error) + func (c *Server) LocalMember() serf.Member + func (s *Server) IsLeader() bool + func (s *Server) JoinLAN(addrs []string) (int, error) + func (s *Server) JoinWAN(addrs []string) (int, error) + func (s *Server) LANMembers() []serf.Member + func (s *Server) Leave() error + func (s *Server) RPC(method string, args interface{}, reply interface{}) error + func (s *Server) RemoveFailedNode(node string) error + func (s *Server) Shutdown() error + func (s *Server) Stats() map[string]map[string]string + func (s *Server) UserEvent(name string, payload []byte) error + func (s *Server) WANMembers() []serf.Member + type Session struct + func (s *Session) Apply(args *structs.SessionRequest, reply *string) error + func (s *Session) Get(args *structs.SessionSpecificRequest, reply *structs.IndexedSessions) error + func (s *Session) List(args *structs.DCSpecificRequest, reply *structs.IndexedSessions) error + func (s *Session) NodeSessions(args *structs.NodeSpecificRequest, reply *structs.IndexedSessions) error + type StateSnapshot struct + func (s *StateSnapshot) ACLList() ([]*structs.ACL, error) + func (s *StateSnapshot) Close() error + func (s *StateSnapshot) KVSDump(stream chan<- interface{}) error + func (s *StateSnapshot) LastIndex() uint64 + func (s *StateSnapshot) NodeChecks(node string) structs.HealthChecks + func (s *StateSnapshot) NodeServices(name string) *structs.NodeServices + func (s *StateSnapshot) Nodes() structs.Nodes + func (s *StateSnapshot) SessionList() ([]*structs.Session, error) + type StateStore struct + func NewStateStore(logOutput io.Writer) (*StateStore, error) + func NewStateStorePath(path string, logOutput io.Writer) (*StateStore, error) + func (s *StateStore) ACLDelete(index uint64, id string) error + func (s *StateStore) ACLGet(id string) (uint64, *structs.ACL, error) + func (s *StateStore) ACLList() (uint64, []*structs.ACL, error) + func (s *StateStore) ACLRestore(acl *structs.ACL) error + func (s *StateStore) ACLSet(index uint64, acl *structs.ACL) error + func (s *StateStore) CheckServiceNodes(service string) (uint64, structs.CheckServiceNodes) + func (s *StateStore) CheckServiceTagNodes(service, tag string) (uint64, structs.CheckServiceNodes) + func (s *StateStore) ChecksInState(state string) (uint64, structs.HealthChecks) + func (s *StateStore) Close() error + func (s *StateStore) DeleteNode(index uint64, node string) error + func (s *StateStore) DeleteNodeCheck(index uint64, node, id string) error + func (s *StateStore) DeleteNodeService(index uint64, node, id string) error + func (s *StateStore) EnsureCheck(index uint64, check *structs.HealthCheck) error + func (s *StateStore) EnsureNode(index uint64, node structs.Node) error + func (s *StateStore) EnsureRegistration(index uint64, req *structs.RegisterRequest) error + func (s *StateStore) EnsureService(index uint64, node string, ns *structs.NodeService) error + func (s *StateStore) GetNode(name string) (uint64, bool, string) + func (s *StateStore) KVSCheckAndSet(index uint64, d *structs.DirEntry) (bool, error) + func (s *StateStore) KVSDelete(index uint64, key string) error + func (s *StateStore) KVSDeleteTree(index uint64, prefix string) error + func (s *StateStore) KVSGet(key string) (uint64, *structs.DirEntry, error) + func (s *StateStore) KVSList(prefix string) (uint64, structs.DirEntries, error) + func (s *StateStore) KVSListKeys(prefix, seperator string) (uint64, []string, error) + func (s *StateStore) KVSLock(index uint64, d *structs.DirEntry) (bool, error) + func (s *StateStore) KVSLockDelay(key string) time.Time + func (s *StateStore) KVSRestore(d *structs.DirEntry) error + func (s *StateStore) KVSSet(index uint64, d *structs.DirEntry) error + func (s *StateStore) KVSUnlock(index uint64, d *structs.DirEntry) (bool, error) + func (s *StateStore) NodeChecks(node string) (uint64, structs.HealthChecks) + func (s *StateStore) NodeDump() (uint64, structs.NodeDump) + func (s *StateStore) NodeInfo(node string) (uint64, structs.NodeDump) + func (s *StateStore) NodeServices(name string) (uint64, *structs.NodeServices) + func (s *StateStore) NodeSessions(node string) (uint64, []*structs.Session, error) + func (s *StateStore) Nodes() (uint64, structs.Nodes) + func (s *StateStore) QueryTables(q string) MDBTables + func (s *StateStore) ServiceChecks(service string) (uint64, structs.HealthChecks) + func (s *StateStore) ServiceNodes(service string) (uint64, structs.ServiceNodes) + func (s *StateStore) ServiceTagNodes(service, tag string) (uint64, structs.ServiceNodes) + func (s *StateStore) Services() (uint64, map[string][]string) + func (s *StateStore) SessionCreate(index uint64, session *structs.Session) error + func (s *StateStore) SessionDestroy(index uint64, id string) error + func (s *StateStore) SessionGet(id string) (uint64, *structs.Session, error) + func (s *StateStore) SessionList() (uint64, []*structs.Session, error) + func (s *StateStore) SessionRestore(session *structs.Session) error + func (s *StateStore) Snapshot() (*StateSnapshot, error) + func (s *StateStore) Watch(tables MDBTables, notify chan struct{}) + type Status struct + func (s *Status) Leader(args struct{}, reply *string) error + func (s *Status) Peers(args struct{}, reply *[]string) error + func (s *Status) Ping(args struct{}, reply *struct{}) error + type StreamClient struct