Documentation ¶
Index ¶
- func ExecCommand(cmd []string, timeoutInMilli int) error
- func ExecCommandFull(cmd []string, env []string, timeoutInMilli int) error
- func IpLookup(host string, preferIPv4 bool) (net.IP, error)
- func IpLookupNoError(host string, preferIPv4 bool) net.IP
- func Logger() macaron.Handler
- func ParseBoolFlag(value string) bool
- type Check
- type CheckAmqp
- type CheckCommon
- type CheckExec
- type CheckHttp
- type CheckHttps
- type CheckKubernetes
- type CheckProxyHttp
- type CheckSql
- type CheckTcp
- type Checker
- type Nerve
- func (n *Nerve) DisableServices(ctx *macaron.Context)
- func (n *Nerve) EnableServices(ctx *macaron.Context)
- func (n *Nerve) Init(version string, buildTime string, logLevelIsSet bool) error
- func (n *Nerve) ServiceDisable(ctx *macaron.Context)
- func (n *Nerve) ServiceEnable(ctx *macaron.Context)
- func (n *Nerve) ServiceStatus(ctx *macaron.Context)
- func (n *Nerve) ServiceWeight(ctx *macaron.Context)
- func (n *Nerve) ServicesStatus(ctx *macaron.Context)
- func (n *Nerve) ServicesWeight(ctx *macaron.Context)
- func (n *Nerve) Start(startStatus chan error)
- func (n *Nerve) Stop()
- type Port
- type Report
- type Reporter
- type ReporterCommon
- type ReporterConsole
- type ReporterFile
- type ReporterZookeeper
- type Service
- func (s *Service) CurrentWeight() uint8
- func (s *Service) Disable(doneWaiter *sync.WaitGroup, shutdown bool)
- func (s *Service) Enable(force bool)
- func (s *Service) Init(n *Nerve) error
- func (s *Service) Start(stopper <-chan struct{}, stopWait *sync.WaitGroup)
- func (s *Service) Warmup(giveUp <-chan struct{})
- type ServiceStatus
- type SharedZkConnection
- type ZKLogger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecCommand ¶
func ParseBoolFlag ¶
Types ¶
type CheckAmqp ¶
type CheckAmqp struct { CheckCommon Datasource string `json:"datasource,omitempty"` Vhost string `json:"vhost,omitempty"` Queue string `json:"queue,omitempty"` Username string `json:"username,omitempty"` Password string `json:"password,omitempty"` // contains filtered or unexported fields }
func NewCheckAmqp ¶
func NewCheckAmqp() *CheckAmqp
type CheckCommon ¶
type CheckCommon struct { Type string `json:"type,omitempty"` Host string `json:"host,omitempty"` Port *int `json:"port,omitempty"` TimeoutInMilli *int `json:"timeoutInMilli,omitempty"` Rise *int `json:"rise,omitempty"` Fall *int `json:"fall,omitempty"` CheckIntervalInMilli *int `json:"checkIntervalInMilli,omitempty"` // contains filtered or unexported fields }
func (*CheckCommon) CommonInit ¶
func (c *CheckCommon) CommonInit(s *Service) error
func (*CheckCommon) CommonRun ¶
func (c *CheckCommon) CommonRun(checker Checker, statusChange chan<- Check, stop <-chan struct{}, doneWait *sync.WaitGroup)
func (*CheckCommon) GetFields ¶
func (c *CheckCommon) GetFields() data.Fields
type CheckExec ¶
type CheckExec struct { CheckCommon Command []string `json:"command,omitempty"` }
func NewCheckExec ¶
func NewCheckExec() *CheckExec
type CheckHttp ¶
type CheckHttp struct { CheckCommon Path string `json:"namespace,omitempty"` // contains filtered or unexported fields }
func NewCheckHttp ¶
func NewCheckHttp() *CheckHttp
type CheckHttps ¶
type CheckHttps struct { CheckCommon Path string `json:"path,omitempty"` // contains filtered or unexported fields }
func NewCheckHttps ¶
func NewCheckHttps() *CheckHttps
func (*CheckHttps) Check ¶
func (x *CheckHttps) Check() error
func (*CheckHttps) Init ¶
func (x *CheckHttps) Init(s *Service) error
func (*CheckHttps) Run ¶
func (x *CheckHttps) Run(statusChange chan Check, stop <-chan struct{}, doneWait *sync.WaitGroup)
func (*CheckHttps) String ¶
func (x *CheckHttps) String() string
type CheckKubernetes ¶
type CheckKubernetes struct { CheckCommon Namespace string `json:"namespace,omitempty"` PodName string `json:"podName,omitempty"` // contains filtered or unexported fields }
func NewCheckKubernetes ¶
func NewCheckKubernetes() *CheckKubernetes
func (*CheckKubernetes) Check ¶
func (x *CheckKubernetes) Check() error
func (*CheckKubernetes) Init ¶
func (x *CheckKubernetes) Init(s *Service) error
type CheckProxyHttp ¶
type CheckProxyHttp struct { CheckCommon ProxyHost string `json:"proxyHost,omitempty"` ProxyPort int `json:"proxyPort,omitempty"` ProxyUsername string `json:"proxyUsername,omitempty"` ProxyPassword string `json:"proxyPassword,omitempty"` Urls []string `json:"urls,omitempty"` FailOnAnyUnreachable bool `json:"failOnAnyUnreachable,omitempty"` // contains filtered or unexported fields }
func NewCheckProxyHttp ¶
func NewCheckProxyHttp() *CheckProxyHttp
func (*CheckProxyHttp) Check ¶
func (x *CheckProxyHttp) Check() error
func (*CheckProxyHttp) Init ¶
func (x *CheckProxyHttp) Init(s *Service) error
type CheckSql ¶
type CheckSql struct { CheckCommon Username string `json:"username,omitempty"` Password string `json:"password,omitempty"` Request string `json:"request,omitempty"` Datasource string `json:"datasource,omitempty"` Driver string `json:"driver,omitempty"` // contains filtered or unexported fields }
func NewCheckSql ¶
func NewCheckSql() *CheckSql
type CheckTcp ¶
type CheckTcp struct { CheckCommon // contains filtered or unexported fields }
func NewCheckTcp ¶
func NewCheckTcp() *CheckTcp
type Checker ¶
type Nerve ¶
type Nerve struct { LogLevel *logs.Level `json:"logLevel,omitempty"` ApiHost string `json:"apiHost,omitempty"` ApiPort int `json:"apiPort,omitempty"` Services []*Service `json:"services,omitempty"` TemplatedConfigPath string `json:"templatedConfigPath,omitempty"` // contains filtered or unexported fields }
func (*Nerve) DisableServices ¶
func (n *Nerve) DisableServices(ctx *macaron.Context)
func (*Nerve) EnableServices ¶
func (n *Nerve) EnableServices(ctx *macaron.Context)
func (*Nerve) ServiceDisable ¶
func (n *Nerve) ServiceDisable(ctx *macaron.Context)
func (*Nerve) ServiceEnable ¶
func (n *Nerve) ServiceEnable(ctx *macaron.Context)
func (*Nerve) ServiceStatus ¶
func (n *Nerve) ServiceStatus(ctx *macaron.Context)
func (*Nerve) ServiceWeight ¶
func (n *Nerve) ServiceWeight(ctx *macaron.Context)
func (*Nerve) ServicesStatus ¶
func (n *Nerve) ServicesStatus(ctx *macaron.Context)
func (*Nerve) ServicesWeight ¶
func (n *Nerve) ServicesWeight(ctx *macaron.Context)
type Report ¶
type Report struct { Available *bool `json:"available"` Host string `json:"host,omitempty"` Port Port `json:"port,omitempty"` Name string `json:"name,omitempty"` HaProxyServerOptions string `json:"haproxy_server_options,omitempty"` Weight *uint8 `json:"weight"` Labels map[string]string `json:"labels,omitempty"` }
func (*Report) UnmarshalJSON ¶
type Reporter ¶
type ReporterCommon ¶
type ReporterCommon struct { Type string `json:"type,omitempty"` // contains filtered or unexported fields }
func (*ReporterCommon) Destroy ¶
func (r *ReporterCommon) Destroy()
func (*ReporterCommon) GetFields ¶
func (r *ReporterCommon) GetFields() data.Fields
func (*ReporterCommon) Init ¶
func (r *ReporterCommon) Init(s *Service) error
type ReporterConsole ¶
type ReporterConsole struct { ReporterCommon // contains filtered or unexported fields }
func NewReporterConsole ¶
func NewReporterConsole() *ReporterConsole
func (*ReporterConsole) Init ¶
func (r *ReporterConsole) Init(s *Service) error
func (*ReporterConsole) Report ¶
func (r *ReporterConsole) Report(report Report) error
type ReporterFile ¶
type ReporterFile struct { ReporterCommon Path string `json:"path,omitempty"` Append bool `json:"append,omitempty"` }
func NewReporterFile ¶
func NewReporterFile() *ReporterFile
func (*ReporterFile) Init ¶
func (r *ReporterFile) Init(s *Service) error
func (*ReporterFile) Report ¶
func (r *ReporterFile) Report(report Report) error
type ReporterZookeeper ¶
type ReporterZookeeper struct { ReporterCommon Path string `json:"path,omitempty"` Hosts []string `json:"hosts,omitempty"` ConnectionTimeoutInMilli *int `json:"connectionTimeoutInMilli,omitempty"` RefreshIntervalInMilli *int `json:"refreshIntervalInMilli,omitempty"` // contains filtered or unexported fields }
func NewReporterZookeeper ¶
func NewReporterZookeeper() *ReporterZookeeper
func (*ReporterZookeeper) Destroy ¶
func (r *ReporterZookeeper) Destroy()
func (*ReporterZookeeper) Init ¶
func (r *ReporterZookeeper) Init(s *Service) error
func (*ReporterZookeeper) Report ¶
func (r *ReporterZookeeper) Report(report Report) error
type Service ¶
type Service struct { Name string `json:"name,omitempty"` Port int `json:"port,omitempty"` Host string `json:"host,omitempty"` PreferIpv4 bool `json:"preferIpv4,omitempty"` Weight uint8 `json:"weight,omitempty"` Checks []json.RawMessage `json:"checks,omitempty"` Reporters []json.RawMessage `json:"reporters,omitempty"` ReporterServiceName string `json:"reporterServiceName,omitempty"` ReportReplayInMilli *int `json:"reportReplayInMilli,omitempty"` HaproxyServerOptions string `json:"haproxyServerOptions,omitempty"` SetServiceAsDownOnShutdown *bool `json:"setServiceAsDownOnShutdown,omitempty"` Labels map[string]string `json:"labels,omitempty"` ExcludeFromGlobalDisable bool `json:"excludeFromGlobalDisable,omitempty"` PreAvailableCommand []string `json:"preAvailableCommand,omitempty"` PreAvailableMaxDurationInMilli *int `json:"preAvailableMaxDurationInMilli,omitempty"` EnableCheckStableCommand []string `json:"enableCheckStableCommand,omitempty"` EnableCheckStableMaxDurationInMilli *int `json:"enableCheckStableMaxDurationInMilli,omitempty"` EnableCheckStableIntervalInMilli *int `json:"enableCheckStableIntervalInMilli,omitempty"` EnableWarmupIntervalInMilli *int `json:"enableWarmupIntervalInMilli,omitempty"` EnableWarmupMaxDurationInMilli *int `json:"enableWarmupMaxDurationInMilli,omitempty"` DisableShutdownCommand []string `json:"disableShutdownCommand,omitempty"` DisableShutdownMaxDurationInMilli *int `json:"disableShutdownMaxDurationInMilli,omitempty"` DisableGracefullyDoneCommand []string `json:"disableGracefullyDoneCommand,omitempty"` DisableGracefullyDoneIntervalInMilli *int `json:"disableGracefullyDoneIntervalInMilli,omitempty"` DisableMaxDurationInMilli *int `json:"disableMaxDurationInMilli,omitempty"` DisableMinDurationInMilli *int `json:"disableMinDurationInMilli,omitempty"` NoMetrics bool `json:"noMetrics,omitempty"` // contains filtered or unexported fields }
func (*Service) CurrentWeight ¶
type ServiceStatus ¶
type SharedZkConnection ¶
type SharedZkConnection struct { // contains filtered or unexported fields }
func NewSharedZkConnection ¶
func NewSharedZkConnection(hosts []string, timeout time.Duration) (*SharedZkConnection, error)
this reuse zk connection if host list is the same a new dedicated event chan is created for each call zk events are duplicated to all those channels
func (*SharedZkConnection) Close ¶
func (z *SharedZkConnection) Close()
func (*SharedZkConnection) CreateEphemeral ¶
func (*SharedZkConnection) Subscribe ¶
func (z *SharedZkConnection) Subscribe() <-chan zk.Event
Source Files ¶
Click to show internal directories.
Click to hide internal directories.