Documentation ¶
Index ¶
Constants ¶
View Source
const ( PingTypeUDP = "udp" PingTypeSocket = "socket" )
View Source
const ( NodeAliveStatus = "Node alive or reachable" NodeCriticalStatus = "Node not live or unreachable" )
View Source
const LeaderKey = "leader"
Variables ¶
View Source
var ( // The maximum time to wait for a ping to complete. MaxRTT = 5 * time.Second )
Functions ¶
func MergeConfig ¶
func MergeConfig(dst *Config, src *HumanConfig)
func MergeConfigPaths ¶
MergeConfigPaths takes a list of config files or config directories and merges them on top of the given config.
func ValidateConfig ¶
ValidateConfig verifies that the given Config object is valid.
Types ¶
type CheckRunner ¶
type CheckRunner struct { sync.RWMutex CheckUpdateInterval time.Duration // contains filtered or unexported fields }
func NewCheckRunner ¶
func (*CheckRunner) Stop ¶
func (c *CheckRunner) Stop()
func (*CheckRunner) UpdateCheck ¶
func (c *CheckRunner) UpdateCheck(checkID types.CheckID, status, output string)
UpdateCheck handles the output of an HTTP/TCP check and decides whether or not to push an update to the catalog.
func (*CheckRunner) UpdateChecks ¶
func (c *CheckRunner) UpdateChecks(checks api.HealthChecks)
UpdateChecks takes a list of checks from the catalog and updates our list of running checks to match.
type Config ¶
type Config struct { LogLevel string EnableSyslog bool SyslogFacility string Service string Tag string KVPath string NodeMeta map[string]string Interval time.Duration DeregisterAfter time.Duration CheckUpdateInterval time.Duration CoordinateUpdateInterval time.Duration NodeReconnectTimeout time.Duration HTTPAddr string Token string Datacenter string CAFile string CAPath string CertFile string KeyFile string TLSServerName string PingType string // contains filtered or unexported fields }
func BuildConfig ¶
BuildConfig builds a new Config object from the default configuration and the list of config files given and returns it after validation.
func DefaultConfig ¶
func DefaultConfig() *Config
func (*Config) ClientConfig ¶
type HumanConfig ¶
type HumanConfig struct { LogLevel flags.StringValue `mapstructure:"log_level"` EnableSyslog flags.BoolValue `mapstructure:"enable_syslog"` SyslogFacility flags.StringValue `mapstructure:"syslog_facility"` Service flags.StringValue `mapstructure:"consul_service"` Tag flags.StringValue `mapstructure:"consul_service_tag"` KVPath flags.StringValue `mapstructure:"consul_kv_path"` NodeMeta []map[string]string `mapstructure:"external_node_meta"` NodeReconnectTimeout flags.DurationValue `mapstructure:"node_reconnect_timeout"` NodeProbeInterval flags.DurationValue `mapstructure:"node_probe_interval"` HTTPAddr flags.StringValue `mapstructure:"http_addr"` Token flags.StringValue `mapstructure:"token"` Datacenter flags.StringValue `mapstructure:"datacenter"` CAFile flags.StringValue `mapstructure:"ca_file"` CAPath flags.StringValue `mapstructure:"ca_path"` CertFile flags.StringValue `mapstructure:"cert_file"` KeyFile flags.StringValue `mapstructure:"key_file"` TLSServerName flags.StringValue `mapstructure:"tls_server_name"` PingType flags.StringValue `mapstructure:"ping_type"` }
func DecodeConfig ¶
func DecodeConfig(r io.Reader) (*HumanConfig, error)
type NodeWatchList ¶
Click to show internal directories.
Click to hide internal directories.