Help us shape the future of Go! Take the 2026 Go Developer Survey

moby

package
v0.315.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2026 License: Apache-2.0 Imports: 22 Imported by: 15

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,
	MatchFirstNetwork:  true,
}

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, opts discovery.DiscovererOptions) (*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, opts discovery.DiscovererOptions) (*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"`
	MatchFirstNetwork bool           `yaml:"match_first_network"`
}

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 added in v0.50.0

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(any) 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 added in v0.50.0

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(any) 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