network

package
v26.0.0-rc3+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NetworkDefault is a platform-independent alias to choose the platform-specific default network stack.
	NetworkDefault = "default"
	// NetworkHost is the name of the predefined network used when the NetworkMode host is selected (only available on Linux)
	NetworkHost = "host"
	// NetworkNone is the name of the predefined network used when the NetworkMode none is selected (available on both Linux and Windows)
	NetworkNone = "none"
	// NetworkBridge is the name of the default network on Linux
	NetworkBridge = "bridge"
	// NetworkNat is the name of the default network on Windows
	NetworkNat = "nat"
)

Variables

This section is empty.

Functions

func ValidateFilters

func ValidateFilters(filter filters.Args) error

ValidateFilters validates the list of filter args with the available filters.

func ValidateIPAM

func ValidateIPAM(ipam *IPAM, enableIPv6 bool) error

ValidateIPAM checks whether the network's IPAM passed as argument is valid. It returns a joinError of the list of errors found.

Types

type Address

type Address struct {
	Addr      string
	PrefixLen int
}

Address represents an IP address

type ConfigReference

type ConfigReference struct {
	Network string
}

ConfigReference specifies the source which provides a network's configuration

type EndpointIPAMConfig

type EndpointIPAMConfig struct {
	IPv4Address  string   `json:",omitempty"`
	IPv6Address  string   `json:",omitempty"`
	LinkLocalIPs []string `json:",omitempty"`
}

EndpointIPAMConfig represents IPAM configurations for the endpoint

func (*EndpointIPAMConfig) Copy

Copy makes a copy of the endpoint ipam config

func (*EndpointIPAMConfig) IsInRange

func (cfg *EndpointIPAMConfig) IsInRange(v4Subnets []NetworkSubnet, v6Subnets []NetworkSubnet) error

IsInRange checks whether static IP addresses are valid in a specific network.

func (*EndpointIPAMConfig) Validate

func (cfg *EndpointIPAMConfig) Validate() error

Validate checks whether cfg is valid.

type EndpointSettings

type EndpointSettings struct {
	// Configurations
	IPAMConfig *EndpointIPAMConfig
	Links      []string
	Aliases    []string // Aliases holds the list of extra, user-specified DNS names for this endpoint.
	// MacAddress may be used to specify a MAC address when the container is created.
	// Once the container is running, it becomes operational data (it may contain a
	// generated address).
	MacAddress string
	// Operational data
	NetworkID           string
	EndpointID          string
	Gateway             string
	IPAddress           string
	IPPrefixLen         int
	IPv6Gateway         string
	GlobalIPv6Address   string
	GlobalIPv6PrefixLen int
	DriverOpts          map[string]string
	// DNSNames holds all the (non fully qualified) DNS names associated to this endpoint. First entry is used to
	// generate PTR records.
	DNSNames []string
}

EndpointSettings stores the network endpoint details

func (*EndpointSettings) Copy

func (es *EndpointSettings) Copy() *EndpointSettings

Copy makes a deep copy of `EndpointSettings`

type IPAM

type IPAM struct {
	Driver  string
	Options map[string]string // Per network IPAM driver options
	Config  []IPAMConfig
}

IPAM represents IP Address Management

type IPAMConfig

type IPAMConfig struct {
	Subnet     string            `json:",omitempty"`
	IPRange    string            `json:",omitempty"`
	Gateway    string            `json:",omitempty"`
	AuxAddress map[string]string `json:"AuxiliaryAddresses,omitempty"`
}

IPAMConfig represents IPAM configurations

type NetworkSubnet

type NetworkSubnet interface {
	// Contains checks whether the NetworkSubnet contains [addr].
	Contains(addr net.IP) bool
	// IsStatic checks whether the subnet was statically allocated (ie. user-defined).
	IsStatic() bool
}

NetworkSubnet describes a user-defined subnet for a specific network. It's only used to validate if an EndpointIPAMConfig is valid for a specific network.

type NetworkingConfig

type NetworkingConfig struct {
	EndpointsConfig map[string]*EndpointSettings // Endpoint configs for each connecting network
}

NetworkingConfig represents the container's networking configuration for each of its interfaces Carries the networking configs specified in the `docker run` and `docker network connect` commands

type PeerInfo

type PeerInfo struct {
	Name string
	IP   string
}

PeerInfo represents one peer of an overlay network

type ServiceInfo

type ServiceInfo struct {
	VIP          string
	Ports        []string
	LocalLBIndex int
	Tasks        []Task
}

ServiceInfo represents service parameters with the list of service's tasks

type Task

type Task struct {
	Name       string
	EndpointID string
	EndpointIP string
	Info       map[string]string
}

Task carries the information about one backend task

Jump to

Keyboard shortcuts

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