moby

package
v0.0.0-...-bec5d16 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultDockerSDConfig = DockerSDConfig{
	RefreshInterval:    model.Duration(60 * time.Second),
	Port:               80,
	Filters:            []Filter{},
	HostNetworkingHost: "localhost",
	HTTPClientConfig:   config.DefaultHTTPClientConfig,
}

DefaultDockerSDConfig is the default Docker SD configuration.

View Source
var DefaultDockerSwarmSDConfig = DockerSwarmSDConfig{
	RefreshInterval:  model.Duration(60 * time.Second),
	Port:             80,
	Filters:          []Filter{},
	HTTPClientConfig: config.DefaultHTTPClientConfig,
}

DefaultDockerSwarmSDConfig is the default Docker Swarm SD configuration.

Functions

This section is empty.

Types

type Discovery

type Discovery struct {
	*refresh.Discovery
	// contains filtered or unexported fields
}

Discovery periodically performs Docker Swarm requests. It implements the Discoverer interface.

func NewDiscovery

func NewDiscovery(conf *DockerSwarmSDConfig, logger log.Logger, metrics discovery.DiscovererMetrics) (*Discovery, error)

NewDiscovery returns a new Discovery which periodically refreshes its targets.

type DockerDiscovery

type DockerDiscovery struct {
	*refresh.Discovery
	// contains filtered or unexported fields
}

func NewDockerDiscovery

func NewDockerDiscovery(conf *DockerSDConfig, logger log.Logger, metrics discovery.DiscovererMetrics) (*DockerDiscovery, error)

NewDockerDiscovery returns a new DockerDiscovery which periodically refreshes its targets.

type DockerSDConfig

type DockerSDConfig struct {
	HTTPClientConfig config.HTTPClientConfig `yaml:",inline"`

	Host               string   `yaml:"host"`
	Port               int      `yaml:"port"`
	Filters            []Filter `yaml:"filters"`
	HostNetworkingHost string   `yaml:"host_networking_host"`

	RefreshInterval model.Duration `yaml:"refresh_interval"`
}

DockerSDConfig is the configuration for Docker (non-swarm) based service discovery.

func (*DockerSDConfig) Name

func (*DockerSDConfig) Name() string

Name returns the name of the Config.

func (*DockerSDConfig) NewDiscoverer

NewDiscoverer returns a Discoverer for the Config.

func (*DockerSDConfig) NewDiscovererMetrics

NewDiscovererMetrics implements discovery.Config.

func (*DockerSDConfig) SetDirectory

func (c *DockerSDConfig) SetDirectory(dir string)

SetDirectory joins any relative file paths with dir.

func (*DockerSDConfig) UnmarshalYAML

func (c *DockerSDConfig) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the yaml.Unmarshaler interface.

type DockerSwarmSDConfig

type DockerSwarmSDConfig struct {
	HTTPClientConfig config.HTTPClientConfig `yaml:",inline"`

	Host    string   `yaml:"host"`
	Role    string   `yaml:"role"`
	Port    int      `yaml:"port"`
	Filters []Filter `yaml:"filters"`

	RefreshInterval model.Duration `yaml:"refresh_interval"`
}

DockerSwarmSDConfig is the configuration for Docker Swarm based service discovery.

func (*DockerSwarmSDConfig) Name

func (*DockerSwarmSDConfig) Name() string

Name returns the name of the Config.

func (*DockerSwarmSDConfig) NewDiscoverer

NewDiscoverer returns a Discoverer for the Config.

func (*DockerSwarmSDConfig) NewDiscovererMetrics

NewDiscovererMetrics implements discovery.Config.

func (*DockerSwarmSDConfig) SetDirectory

func (c *DockerSwarmSDConfig) SetDirectory(dir string)

SetDirectory joins any relative file paths with dir.

func (*DockerSwarmSDConfig) UnmarshalYAML

func (c *DockerSwarmSDConfig) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the yaml.Unmarshaler interface.

type Filter

type Filter struct {
	Name   string   `yaml:"name"`
	Values []string `yaml:"values"`
}

Filter represent a filter that can be passed to Docker Swarm to reduce the amount of data received.

Jump to

Keyboard shortcuts

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