Versions in this module Expand all Collapse all v0 v0.1.0 Apr 16, 2014 Changes in this version + const MaxRPCVersion + const MinRPCVersion + func FixupCheckType(raw interface{}) error + func LevelFilter() *logutils.LevelFilter + func NewLogWriter(buf int) *logWriter + func ValidateLevelFilter(minLevel logutils.LogLevel, filter *logutils.LevelFilter) bool + type Agent struct + func Create(config *Config, logOutput io.Writer) (*Agent, error) + func (a *Agent) AddCheck(check *structs.HealthCheck, chkType *CheckType) error + func (a *Agent) AddService(service *structs.NodeService, chkType *CheckType) error + func (a *Agent) ForceLeave(node string) (err error) + func (a *Agent) JoinLAN(addrs []string) (n int, err error) + func (a *Agent) JoinWAN(addrs []string) (n int, err error) + func (a *Agent) LANMembers() []serf.Member + func (a *Agent) Leave() error + func (a *Agent) PauseSync() + func (a *Agent) RPC(method string, args interface{}, reply interface{}) error + func (a *Agent) RemoveCheck(checkID string) error + func (a *Agent) RemoveService(serviceID string) error + func (a *Agent) ResumeSync() + func (a *Agent) Shutdown() error + func (a *Agent) ShutdownCh() <-chan struct{} + func (a *Agent) StartSync() + func (a *Agent) Stats() map[string]map[string]string + func (a *Agent) UpdateCheck(checkID, status, output string) error + func (a *Agent) WANMembers() []serf.Member + type AgentRPC struct + func NewAgentRPC(agent *Agent, listener net.Listener, logOutput io.Writer, logWriter *logWriter) *AgentRPC + func (i *AgentRPC) Shutdown() + type AppendSliceValue []string + func (s *AppendSliceValue) Set(value string) error + func (s *AppendSliceValue) String() string + type CheckDefinition struct + ID string + Name string + Notes string + func DecodeCheckDefinition(raw interface{}) (*CheckDefinition, error) + func (c *CheckDefinition) HealthCheck(node string) *structs.HealthCheck + type CheckMonitor struct + CheckID string + Interval time.Duration + Logger *log.Logger + Notify CheckNotifier + Script string + func (c *CheckMonitor) Start() + func (c *CheckMonitor) Stop() + type CheckNotifier interface + UpdateCheck func(checkID, status, note string) + type CheckTTL struct + CheckID string + Logger *log.Logger + Notify CheckNotifier + TTL time.Duration + func (c *CheckTTL) SetStatus(status, note string) + func (c *CheckTTL) Start() + func (c *CheckTTL) Stop() + type CheckType struct + Interval time.Duration + Script string + TTL time.Duration + func (c *CheckType) IsMonitor() bool + func (c *CheckType) IsTTL() bool + func (c *CheckType) Valid() bool + type Command struct + ShutdownCh <-chan struct{} + Ui cli.Ui + func (c *Command) Help() string + func (c *Command) Run(args []string) int + func (c *Command) Synopsis() string + type Config struct + AEInterval time.Duration + AdvertiseAddr string + BindAddr string + Bootstrap bool + CAFile string + CertFile string + Checks []*CheckDefinition + ClientAddr string + ConsulConfig *consul.Config + DNSRecursor string + DataDir string + Datacenter string + Domain string + EnableDebug bool + EncryptKey string + KeyFile string + LeaveOnTerm bool + LogLevel string + NodeName string + Ports PortConfig + Protocol int + Server bool + Services []*ServiceDefinition + SkipLeaveOnInt bool + StartJoin []string + StatsiteAddr string + VerifyIncoming bool + VerifyOutgoing bool + func DecodeConfig(r io.Reader) (*Config, error) + func DefaultConfig() *Config + func MergeConfig(a, b *Config) *Config + func ReadConfigPaths(paths []string) (*Config, error) + func (c *Config) ClientListener(port int) (*net.TCPAddr, error) + func (c *Config) EncryptBytes() ([]byte, error) + type DNSServer struct + func NewDNSServer(agent *Agent, logOutput io.Writer, domain, bind, recursor string) (*DNSServer, error) + type GatedWriter struct + Writer io.Writer + func (w *GatedWriter) Flush() + func (w *GatedWriter) Write(p []byte) (n int, err error) + type HTTPServer struct + func NewHTTPServer(agent *Agent, enableDebug bool, logOutput io.Writer, bind string) (*HTTPServer, error) + func (s *HTTPServer) AgentCheckFail(resp http.ResponseWriter, req *http.Request) (interface{}, error) + func (s *HTTPServer) AgentCheckPass(resp http.ResponseWriter, req *http.Request) (interface{}, error) + func (s *HTTPServer) AgentCheckWarn(resp http.ResponseWriter, req *http.Request) (interface{}, error) + func (s *HTTPServer) AgentChecks(resp http.ResponseWriter, req *http.Request) (interface{}, error) + func (s *HTTPServer) AgentDeregisterCheck(resp http.ResponseWriter, req *http.Request) (interface{}, error) + func (s *HTTPServer) AgentDeregisterService(resp http.ResponseWriter, req *http.Request) (interface{}, error) + func (s *HTTPServer) AgentForceLeave(resp http.ResponseWriter, req *http.Request) (interface{}, error) + func (s *HTTPServer) AgentJoin(resp http.ResponseWriter, req *http.Request) (interface{}, error) + func (s *HTTPServer) AgentMembers(resp http.ResponseWriter, req *http.Request) (interface{}, error) + func (s *HTTPServer) AgentRegisterCheck(resp http.ResponseWriter, req *http.Request) (interface{}, error) + func (s *HTTPServer) AgentRegisterService(resp http.ResponseWriter, req *http.Request) (interface{}, error) + func (s *HTTPServer) AgentServices(resp http.ResponseWriter, req *http.Request) (interface{}, error) + func (s *HTTPServer) CatalogDatacenters(resp http.ResponseWriter, req *http.Request) (interface{}, error) + func (s *HTTPServer) CatalogDeregister(resp http.ResponseWriter, req *http.Request) (interface{}, error) + func (s *HTTPServer) CatalogNodeServices(resp http.ResponseWriter, req *http.Request) (uint64, interface{}, error) + func (s *HTTPServer) CatalogNodes(resp http.ResponseWriter, req *http.Request) (uint64, interface{}, error) + func (s *HTTPServer) CatalogRegister(resp http.ResponseWriter, req *http.Request) (interface{}, error) + func (s *HTTPServer) CatalogServiceNodes(resp http.ResponseWriter, req *http.Request) (uint64, interface{}, error) + func (s *HTTPServer) CatalogServices(resp http.ResponseWriter, req *http.Request) (uint64, interface{}, error) + func (s *HTTPServer) HealthChecksInState(resp http.ResponseWriter, req *http.Request) (uint64, interface{}, error) + func (s *HTTPServer) HealthNodeChecks(resp http.ResponseWriter, req *http.Request) (uint64, interface{}, error) + func (s *HTTPServer) HealthServiceChecks(resp http.ResponseWriter, req *http.Request) (uint64, interface{}, error) + func (s *HTTPServer) HealthServiceNodes(resp http.ResponseWriter, req *http.Request) (uint64, interface{}, error) + func (s *HTTPServer) Index(resp http.ResponseWriter, req *http.Request) + func (s *HTTPServer) KVSDelete(resp http.ResponseWriter, req *http.Request, args *structs.KeyRequest) (interface{}, error) + func (s *HTTPServer) KVSEndpoint(resp http.ResponseWriter, req *http.Request) (interface{}, error) + func (s *HTTPServer) KVSGet(resp http.ResponseWriter, req *http.Request, args *structs.KeyRequest) (interface{}, error) + func (s *HTTPServer) KVSPut(resp http.ResponseWriter, req *http.Request, args *structs.KeyRequest) (interface{}, error) + func (s *HTTPServer) Shutdown() + func (s *HTTPServer) StatusLeader(resp http.ResponseWriter, req *http.Request) (interface{}, error) + func (s *HTTPServer) StatusPeers(resp http.ResponseWriter, req *http.Request) (interface{}, error) + type LogHandler interface + HandleLog func(string) + type Member struct + Addr net.IP + DelegateCur uint8 + DelegateMax uint8 + DelegateMin uint8 + Name string + Port uint16 + ProtocolCur uint8 + ProtocolMax uint8 + ProtocolMin uint8 + Status string + Tags map[string]string + type PortConfig struct + DNS int + HTTP int + RPC int + SerfLan int + SerfWan int + Server int + type RPCClient struct + func NewRPCClient(addr string) (*RPCClient, error) + func (c *RPCClient) Close() error + func (c *RPCClient) ForceLeave(node string) error + func (c *RPCClient) Join(addrs []string, wan bool) (int, error) + func (c *RPCClient) LANMembers() ([]Member, error) + func (c *RPCClient) Leave() error + func (c *RPCClient) Monitor(level logutils.LogLevel, ch chan<- string) (StreamHandle, error) + func (c *RPCClient) Stats() (map[string]map[string]string, error) + func (c *RPCClient) Stop(handle StreamHandle) error + func (c *RPCClient) WANMembers() ([]Member, error) + type ServiceDefinition struct + Check CheckType + ID string + Name string + Port int + Tags []string + func DecodeServiceDefinition(raw interface{}) (*ServiceDefinition, error) + func (s *ServiceDefinition) CheckType() *CheckType + func (s *ServiceDefinition) NodeService() *structs.NodeService + type StreamHandle uint64