Versions in this module Expand all Collapse all v0 v0.1.1 Dec 26, 2014 Changes in this version + const CheckBufSize + const MaxRPCVersion + const MinInterval + const MinRPCVersion + const WatchBufSize + func ExecScript(script string) (*exec.Cmd, error) + func FixupCheckType(raw interface{}) error + func FixupLockDelay(raw interface{}) error + func LevelFilter() *logutils.LevelFilter + func NewLogWriter(buf int) *logWriter + func ValidateLevelFilter(minLevel logutils.LogLevel, filter *logutils.LevelFilter) bool + type AddressConfig struct + DNS string + HTTP string + RPC string + 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) LastUserEvent() *UserEvent + func (a *Agent) Leave() error + func (a *Agent) LocalMember() serf.Member + 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) UserEvent(dc string, params *UserEvent) error + func (a *Agent) UserEvents() []*UserEvent + 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) ReloadCh() <-chan struct{} + func (i *AgentRPC) Shutdown() + type AgentSelf struct + Config *Config + Member serf.Member + 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, output string) + type CheckTTL struct + CheckID string + Logger *log.Logger + Notify CheckNotifier + TTL time.Duration + func (c *CheckTTL) SetStatus(status, output 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 + Revision string + ShutdownCh <-chan struct{} + Ui cli.Ui + Version string + VersionPrerelease string + func (c *Command) Help() string + func (c *Command) Run(args []string) int + func (c *Command) Synopsis() string + type Config struct + ACLDatacenter string + ACLDefaultPolicy string + ACLDownPolicy string + ACLMasterToken string + ACLTTL time.Duration + ACLTTLRaw string + ACLToken string + AEInterval time.Duration + Addresses AddressConfig + AdvertiseAddr string + BindAddr string + Bootstrap bool + BootstrapExpect int + CAFile string + CertFile string + CheckUpdateInterval time.Duration + CheckUpdateIntervalRaw string + Checks []*CheckDefinition + ClientAddr string + ConsulConfig *consul.Config + DNSConfig DNSConfig + DNSRecursor string + DataDir string + Datacenter string + DisableAnonymousSignature bool + DisableRemoteExec bool + DisableUpdateCheck bool + Domain string + EnableDebug bool + EnableSyslog bool + EncryptKey string + KeyFile string + LeaveOnTerm bool + LogLevel string + NodeName string + PidFile string + Ports PortConfig + Protocol int + RejoinAfterLeave bool + RetryInterval time.Duration + RetryIntervalRaw string + RetryJoin []string + RetryMaxAttempts int + Revision string + Server bool + ServerName string + Services []*ServiceDefinition + SkipLeaveOnInt bool + StartJoin []string + StatsdAddr string + StatsiteAddr string + SyslogFacility string + UiDir string + VerifyIncoming bool + VerifyOutgoing bool + Version string + VersionPrerelease string + WatchPlans []*watch.WatchPlan + Watches []map[string]interface{} + 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(override string, port int) (*net.TCPAddr, error) + func (c *Config) ClientListenerAddr(override string, port int) (string, error) + func (c *Config) EncryptBytes() ([]byte, error) + type DNSConfig struct + AllowStale bool + EnableTruncate bool + MaxStale time.Duration + MaxStaleRaw string + NodeTTL time.Duration + NodeTTLRaw string + ServiceTTL map[string]time.Duration + ServiceTTLRaw map[string]string + type DNSServer struct + func NewDNSServer(agent *Agent, config *DNSConfig, logOutput io.Writer, ...) (*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, uiDir string, enableDebug bool, logOutput io.Writer, bind string) (*HTTPServer, error) + func (s *HTTPServer) ACLClone(resp http.ResponseWriter, req *http.Request) (interface{}, error) + func (s *HTTPServer) ACLCreate(resp http.ResponseWriter, req *http.Request) (interface{}, error) + func (s *HTTPServer) ACLDestroy(resp http.ResponseWriter, req *http.Request) (interface{}, error) + func (s *HTTPServer) ACLGet(resp http.ResponseWriter, req *http.Request) (interface{}, error) + func (s *HTTPServer) ACLList(resp http.ResponseWriter, req *http.Request) (interface{}, error) + func (s *HTTPServer) ACLUpdate(resp http.ResponseWriter, req *http.Request) (interface{}, 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) AgentSelf(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) (interface{}, error) + func (s *HTTPServer) CatalogNodes(resp http.ResponseWriter, req *http.Request) (interface{}, error) + func (s *HTTPServer) CatalogRegister(resp http.ResponseWriter, req *http.Request) (interface{}, error) + func (s *HTTPServer) CatalogServiceNodes(resp http.ResponseWriter, req *http.Request) (interface{}, error) + func (s *HTTPServer) CatalogServices(resp http.ResponseWriter, req *http.Request) (interface{}, error) + func (s *HTTPServer) EventFire(resp http.ResponseWriter, req *http.Request) (interface{}, error) + func (s *HTTPServer) EventList(resp http.ResponseWriter, req *http.Request) (interface{}, error) + func (s *HTTPServer) HealthChecksInState(resp http.ResponseWriter, req *http.Request) (interface{}, error) + func (s *HTTPServer) HealthNodeChecks(resp http.ResponseWriter, req *http.Request) (interface{}, error) + func (s *HTTPServer) HealthServiceChecks(resp http.ResponseWriter, req *http.Request) (interface{}, error) + func (s *HTTPServer) HealthServiceNodes(resp http.ResponseWriter, req *http.Request) (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) KVSGetKeys(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) SessionCreate(resp http.ResponseWriter, req *http.Request) (interface{}, error) + func (s *HTTPServer) SessionDestroy(resp http.ResponseWriter, req *http.Request) (interface{}, error) + func (s *HTTPServer) SessionGet(resp http.ResponseWriter, req *http.Request) (interface{}, error) + func (s *HTTPServer) SessionList(resp http.ResponseWriter, req *http.Request) (interface{}, error) + func (s *HTTPServer) SessionsForNode(resp http.ResponseWriter, req *http.Request) (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) + func (s *HTTPServer) UINodeInfo(resp http.ResponseWriter, req *http.Request) (interface{}, error) + func (s *HTTPServer) UINodes(resp http.ResponseWriter, req *http.Request) (interface{}, error) + func (s *HTTPServer) UIServices(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) Reload() 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 ServiceSummary struct + ChecksCritical int + ChecksPassing int + ChecksWarning int + Name string + Nodes []string + type StreamHandle uint64 + type SyslogWrapper struct + func (s *SyslogWrapper) Write(p []byte) (int, error) + type UserEvent struct + ID string + LTime uint64 + Name string + NodeFilter string + Payload []byte + ServiceFilter string + TagFilter string + Version int