docker

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	HTTPClientConfig config.HTTPClientConfig `yaml:",inline"`
	Host             string                  `yaml:"host"`
	RefreshInterval  time.Duration           `yaml:"refresh_interval"`

	// prefix for instance. The Container name is appended
	InstancePrefix string
	// network that the Container must be a member of
	TargetNetwork string
}

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

type Discovery

type Discovery struct {
	// contains filtered or unexported fields
}

func New

func New(conf *Config) (*Discovery, error)

func (*Discovery) Refresh

func (d *Discovery) Refresh(ctx context.Context) ([]Meta, error)

type Meta

type Meta struct {
	Name    string
	Address string
	Labels  map[string]string

	HasJob            bool
	IsInTargetNetwork bool
	HasTCPPorts       bool // at least 1 TCP port
	HasExplicitPort   bool // explicit or single port
}

func (Meta) IsExported

func (m Meta) IsExported() bool

whether the Container is exported

Jump to

Keyboard shortcuts

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