Versions in this module Expand all Collapse all v0 v0.1.0 Apr 16, 2014 Changes in this version + const ConsulServiceID + const ConsulServiceName + const DefaultDC + const DefaultLANSerfPort + const DefaultWANSerfPort + const ProtocolVersionMax + const ProtocolVersionMin + 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 GetPrivateIP() (*net.IPNet, error) + func NewFSM(logOutput io.Writer) (*consulFSM, 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) 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 + type Config struct + Bootstrap bool + 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 + SerfLANConfig *serf.Config + SerfWANConfig *serf.Config + ServerUp func() + VerifyIncoming bool + VerifyOutgoing bool + func DefaultConfig() *Config + func (c *Config) CACertificate() (*x509.Certificate, 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(maxTime time.Duration, tlsConfig *tls.Config) *ConnPool + func (p *ConnPool) RPC(addr net.Addr, method string, args interface{}, reply interface{}) error + func (p *ConnPool) Shutdown() error + 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 + RPC func(method string, args interface{}, reply interface{}) 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 + type MDBIndex struct + AllowBlank 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) 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 + type NotifyGroup struct + func (n *NotifyGroup) Notify() + func (n *NotifyGroup) Wait(ch chan struct{}) + func (n *NotifyGroup) WaitCh() chan struct{} + type RPCType byte + type Raft struct + func (r *Raft) RemovePeer(args string, reply *struct{}) error + func (r *Raft) Snapshot(args struct{}, reply *struct{}) error + 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 (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) WANMembers() []serf.Member + type StateSnapshot struct + 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 + type StateStore struct + func NewStateStore(logOutput io.Writer) (*StateStore, 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) 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) KVSRestore(d *structs.DirEntry) error + func (s *StateStore) KVSSet(index uint64, d *structs.DirEntry) error + func (s *StateStore) NodeChecks(node string) (uint64, structs.HealthChecks) + func (s *StateStore) NodeServices(name string) (uint64, *structs.NodeServices) + 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) 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