consul

package
v1.36.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2020 License: Apache-2.0 Imports: 9 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLabels

func GetLabels(sdc *SDConfig, baseDir string) ([]map[string]string, error)

GetLabels returns Consul labels according to sdc.

Types

type Agent

type Agent struct {
	Config AgentConfig
}

Agent is Consul agent.

See https://www.consul.io/api/agent.html#read-configuration

type AgentConfig

type AgentConfig struct {
	Datacenter string
}

AgentConfig is Consul agent config.

See https://www.consul.io/api/agent.html#read-configuration

type Check

type Check struct {
	CheckID string
	Status  string
}

Check is Consul check.

See https://www.consul.io/api/health.html#list-nodes-for-service

type Node

type Node struct {
	Address         string
	Datacenter      string
	Node            string
	Meta            map[string]string
	TaggedAddresses map[string]string
}

Node is Consul node.

See https://www.consul.io/api/health.html#list-nodes-for-service

type SDConfig

type SDConfig struct {
	Server       string              `yaml:"server"`
	Token        *string             `yaml:"token"`
	Datacenter   string              `yaml:"datacenter"`
	Scheme       string              `yaml:"scheme"`
	Username     string              `yaml:"username"`
	Password     string              `yaml:"password"`
	TLSConfig    *promauth.TLSConfig `yaml:"tls_config"`
	Services     []string            `yaml:"services"`
	Tags         []string            `yaml:"tags"`
	NodeMeta     map[string]string   `yaml:"node_meta"`
	TagSeparator *string             `yaml:"tag_separator"`
	AllowStale   bool                `yaml:"allow_stale"`
}

SDConfig represents service discovery config for Consul.

See https://prometheus.io/docs/prometheus/latest/configuration/configuration/#consul_sd_config

type Service

type Service struct {
	ID      string
	Service string
	Address string
	Port    int
	Tags    []string
	Meta    map[string]string
}

Service is Consul service.

See https://www.consul.io/api/health.html#list-nodes-for-service

type ServiceNode

type ServiceNode struct {
	Service Service
	Node    Node
	Checks  []Check
}

ServiceNode is Consul service node.

See https://www.consul.io/api/health.html#list-nodes-for-service

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL