Documentation
¶
Index ¶
- type Config
- type ConfigConfab
- type ConfigConsul
- type ConfigConsulAgent
- type ConfigConsulAgentDnsConfig
- type ConfigConsulAgentPorts
- type ConfigConsulAgentServers
- type ConfigConsulTelemetry
- type ConfigNode
- type ConfigPath
- type ConsulConfig
- type ConsulConfigDnsConfig
- type ConsulConfigPerformance
- type ConsulConfigPorts
- type ConsulConfigServiceTTL
- type ConsulConfigTelemetry
- type ServiceDefiner
- type ServiceDefinition
- type ServiceDefinitionCheck
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Node ConfigNode Confab ConfigConfab Consul ConfigConsul Path ConfigPath }
func ConfigFromJSON ¶
type ConfigConfab ¶
type ConfigConfab struct {
TimeoutInSeconds int `json:"timeout_in_seconds"`
}
type ConfigConsul ¶
type ConfigConsul struct { Agent ConfigConsulAgent EncryptKeys []string `json:"encrypt_keys"` }
type ConfigConsulAgent ¶
type ConfigConsulAgent struct { Servers ConfigConsulAgentServers `json:"servers"` Services map[string]ServiceDefinition `json:"services"` Mode string `json:"mode"` Domain string `json:"domain"` Datacenter string `json:"datacenter"` LogLevel string `json:"log_level"` ProtocolVersion int `json:"protocol_version"` DnsConfig ConfigConsulAgentDnsConfig `json:"dns_config"` Telemetry ConfigConsulTelemetry `json:"telemetry"` Bootstrap bool `json:"bootstrap"` NodeName string `json:"node_name"` RequireSSL bool `json:"require_ssl"` Ports ConfigConsulAgentPorts `json:"ports"` }
type ConfigConsulAgentPorts ¶
type ConfigConsulAgentPorts struct {
DNS int `json:"dns"`
}
type ConfigConsulTelemetry ¶
type ConfigConsulTelemetry struct {
StatsdAddress string `json:"statsd_address"`
}
type ConfigNode ¶
type ConfigPath ¶
type ConsulConfig ¶
type ConsulConfig struct { Server bool `json:"server"` Domain string `json:"domain"` Datacenter string `json:"datacenter"` DataDir string `json:"data_dir"` LogLevel string `json:"log_level"` NodeName string `json:"node_name"` Ports ConsulConfigPorts `json:"ports"` RejoinAfterLeave bool `json:"rejoin_after_leave"` BindAddr string `json:"bind_addr"` DisableRemoteExec bool `json:"disable_remote_exec"` DisableUpdateCheck bool `json:"disable_update_check"` Protocol int `json:"protocol"` VerifyOutgoing *bool `json:"verify_outgoing,omitempty"` VerifyIncoming *bool `json:"verify_incoming,omitempty"` VerifyServerHostname *bool `json:"verify_server_hostname,omitempty"` CAFile *string `json:"ca_file,omitempty"` KeyFile *string `json:"key_file,omitempty"` CertFile *string `json:"cert_file,omitempty"` Encrypt *string `json:"encrypt,omitempty"` DnsConfig ConsulConfigDnsConfig `json:"dns_config"` Bootstrap *bool `json:"bootstrap,omitempty"` Performance ConsulConfigPerformance `json:"performance"` Telemetry *ConsulConfigTelemetry `json:"telemetry,omitempty"` TLSMinVersion string `json:"tls_min_version"` }
func GenerateConfiguration ¶
func GenerateConfiguration(config Config, configDir, nodeName string) ConsulConfig
type ConsulConfigDnsConfig ¶
type ConsulConfigDnsConfig struct { AllowStale bool `json:"allow_stale"` MaxStale string `json:"max_stale"` RecursorTimeout string `json:"recursor_timeout"` ServiceTTL ConsulConfigServiceTTL `json:"service_ttl"` }
type ConsulConfigPerformance ¶
type ConsulConfigPerformance struct {
RaftMultiplier int `json:"raft_multiplier"`
}
type ConsulConfigPorts ¶
type ConsulConfigServiceTTL ¶
type ConsulConfigServiceTTL struct {
AllServices string `json:"*"`
}
type ConsulConfigTelemetry ¶
type ConsulConfigTelemetry struct {
StatsdAddress string `json:"statsd_address,omitempty"`
}
type ServiceDefiner ¶
type ServiceDefiner struct {
Logger logger
}
func (ServiceDefiner) GenerateDefinitions ¶
func (s ServiceDefiner) GenerateDefinitions(config Config) ([]ServiceDefinition, error)
func (ServiceDefiner) WriteDefinitions ¶
func (s ServiceDefiner) WriteDefinitions(configDir string, definitions []ServiceDefinition) error
type ServiceDefinition ¶
type ServiceDefinition struct { ServiceName string `json:"-"` Name string `json:"name"` Check *ServiceDefinitionCheck `json:"check,omitempty"` Checks []ServiceDefinitionCheck `json:"checks,omitempty"` Tags []string `json:"tags,omitempty"` Address string `json:"address,omitempty"` Port int `json:"port,omitempty"` EnableTagOverride bool `json:"enableTagOverride,omitempty"` ID string `json:"id,omitempty"` Token string `json:"token,omitempty"` }
type ServiceDefinitionCheck ¶
type ServiceDefinitionCheck struct { Name string `json:"name"` ID string `json:"id,omitempty"` Script string `json:"script,omitempty"` HTTP string `json:"http,omitempty"` TCP string `json:"tcp,omitempty"` TTL string `json:"ttl,omitempty"` Interval string `json:"interval,omitempty"` Timeout string `json:"timeout,omitempty"` Notes string `json:"notes,omitempty"` DockerContainerID string `json:"docker_container_id,omitempty"` Shell string `json:"shell,omitempty"` Status string `json:"status,omitempty"` ServiceID string `json:"service_id,omitempty"` }
Click to show internal directories.
Click to hide internal directories.