[go: up one dir, main page]

network

package
v2.0.0-beta.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultNetwork = defaultNetwork

DefaultNetwork is the name of the default network driver to use for containers on the daemon platform. The default for Linux containers is "bridge" (network.NetworkBridge), and "nat" (network.NetworkNat) for Windows containers.

Variables

This section is empty.

Functions

func IsPredefined

func IsPredefined(network string) bool

IsPredefined indicates if a network is predefined by the daemon.

Types

type AttachmentStore

type AttachmentStore struct {
	sync.Mutex
	// contains filtered or unexported fields
}

AttachmentStore stores the load balancer IP address for a network id.

func (*AttachmentStore) ClearAttachments

func (store *AttachmentStore) ClearAttachments()

ClearAttachments clears all the mappings of network to load balancer IP Address.

func (*AttachmentStore) GetIPForNetwork

func (store *AttachmentStore) GetIPForNetwork(networkID string) (net.IP, bool)

GetIPForNetwork return the load balancer IP address for the given network.

func (*AttachmentStore) ResetAttachments

func (store *AttachmentStore) ResetAttachments(attachments map[string]string) error

ResetAttachments clears any existing load balancer IP to network mapping and sets the mapping to the given attachments.

type EndpointSettings

type EndpointSettings struct {
	*networktypes.EndpointSettings
	IPAMOperational bool
	// DesiredMacAddress is the configured value, it's copied from MacAddress (the
	// API param field) when the container is created.
	DesiredMacAddress string
}

EndpointSettings is a package local wrapper for networktypes.EndpointSettings which stores Endpoint state that needs to be persisted to disk but not exposed in the api.

type Filter

type Filter struct {

	// IDAlsoMatchesName makes the "id" filter term also match against
	// network names.
	IDAlsoMatchesName bool
	// contains filtered or unexported fields
}

func NewFilter

func NewFilter(args filters.Args) (Filter, error)

NewFilter returns a network list filter that filters by the provided args.

An errdefs.InvalidParameter error is returned if the filter args are not well-formed.

func NewPruneFilter

func NewPruneFilter(args filters.Args) (Filter, error)

NewPruneFilter returns a network prune filter that filters by the provided args.

The filter matches dangling networks which also match args.

func (Filter) Get

func (f Filter) Get(key string) []string

func (Filter) Matches

func (f Filter) Matches(nw FilterNetwork) bool

Matches returns true if nw satisfies the filter criteria.

type FilterNetwork

type FilterNetwork interface {
	Driver() string
	Name() string
	ID() string
	Labels() map[string]string
	Scope() string
	Created() time.Time
	HasContainerAttachments() bool
	HasServiceAttachments() bool
}

type Settings

type Settings struct {
	Bridge                 string
	SandboxID              string
	SandboxKey             string
	HairpinMode            bool
	LinkLocalIPv6Address   string
	LinkLocalIPv6PrefixLen int
	Networks               map[string]*EndpointSettings
	Service                *clustertypes.ServiceConfig
	Ports                  container.PortMap
	SecondaryIPAddresses   []networktypes.Address
	SecondaryIPv6Addresses []networktypes.Address
	HasSwarmEndpoint       bool
}

Settings stores configuration details about the daemon network config TODO Windows. Many of these fields can be factored out.,

Jump to

Keyboard shortcuts

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