network
packageThis package is not in the latest version of its module.
Details
Valid go.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Index¶
- Constants
- func ValidateFilters(filter filters.Args) error
- func ValidateIPAM(ipam *IPAM, enableIPv6 bool) error
- type Address
- type ConfigReference
- type ConnectOptions
- type CreateOptions
- type CreateRequest
- type CreateResponse
- type DisconnectOptions
- type EndpointIPAMConfig
- type EndpointResource
- type EndpointSettings
- type IPAM
- type IPAMConfig
- type Inspect
- type InspectOptions
- type ListOptions
- type NetworkSubnet
- type NetworkingConfig
- type PeerInfo
- type PruneReport
- type ServiceInfo
- type Summary
- type Task
Constants¶
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 LinuxNetworkBridge = "bridge"// NetworkNat is the name of the default network on WindowsNetworkNat = "nat")
Variables¶
This section is empty.
Functions¶
funcValidateFilters¶
ValidateFilters validates the list of filter args with the available filters.
funcValidateIPAM¶
ValidateIPAM checks whether the network's IPAM passed as argument is valid. It returns a joinError of the list oferrors found.
Types¶
typeConfigReference¶
type ConfigReference struct {Networkstring}ConfigReference specifies the source which provides a network's configuration
typeConnectOptions¶
type ConnectOptions struct {ContainerstringEndpointConfig *EndpointSettings `json:",omitempty"`}ConnectOptions represents the data to be used to connect a container to thenetwork.
typeCreateOptions¶
type CreateOptions struct {Driverstring// Driver is the driver-name used to create the network (e.g. `bridge`, `overlay`)Scopestring// Scope describes the level at which the network exists (e.g. `swarm` for cluster-wide or `local` for machine level).EnableIPv4 *bool `json:",omitempty"`// EnableIPv4 represents whether to enable IPv4.EnableIPv6 *bool `json:",omitempty"`// EnableIPv6 represents whether to enable IPv6.IPAM *IPAM// IPAM is the network's IP Address Management.Internalbool// Internal represents if the network is used internal only.Attachablebool// Attachable represents if the global scope is manually attachable by regular containers from workers in swarm mode.Ingressbool// Ingress indicates the network is providing the routing-mesh for the swarm cluster.ConfigOnlybool// ConfigOnly creates a config-only network. Config-only networks are place-holder networks for network configurations to be used by other networks. ConfigOnly networks cannot be used directly to run containers or services.ConfigFrom *ConfigReference// ConfigFrom specifies the source which will provide the configuration for this network. The specified network must be a config-only network; see [CreateOptions.ConfigOnly].Options map[string]string// Options specifies the network-specific options to use for when creating the network.Labels map[string]string// Labels holds metadata specific to the network being created.}CreateOptions holds options to create a network.
typeCreateRequest¶
type CreateRequest struct {CreateOptionsNamestring// Name is the requested name of the network.// Deprecated: CheckDuplicate is deprecated since API v1.44, but it defaults to true when sent by the client// package to older daemons.CheckDuplicate *bool `json:",omitempty"`}CreateRequest is the request message sent to the server for network create call.
typeCreateResponse¶
type CreateResponse struct {// The ID of the created network.// Required: trueIDstring `json:"Id"`// Warnings encountered when creating the container// Required: trueWarningstring `json:"Warning"`}CreateResponse NetworkCreateResponse
OK response to NetworkCreate operationswagger:model CreateResponse
typeDisconnectOptions¶
DisconnectOptions represents the data to be used to disconnect a containerfrom the network.
typeEndpointIPAMConfig¶
type EndpointIPAMConfig struct {IPv4Addressstring `json:",omitempty"`IPv6Addressstring `json:",omitempty"`LinkLocalIPs []string `json:",omitempty"`}EndpointIPAMConfig represents IPAM configurations for the endpoint
func (*EndpointIPAMConfig)Copy¶
func (cfg *EndpointIPAMConfig) Copy() *EndpointIPAMConfig
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.
typeEndpointResource¶
type EndpointResource struct {NamestringEndpointIDstringMacAddressstringIPv4AddressstringIPv6Addressstring}EndpointResource contains network resources allocated and used for acontainer in a network.
typeEndpointSettings¶
type EndpointSettings struct {// ConfigurationsIPAMConfig *EndpointIPAMConfigLinks []stringAliases []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).MacAddressstringDriverOpts map[string]string// GwPriority determines which endpoint will provide the default gateway// for the container. The endpoint with the highest priority will be used.// If multiple endpoints have the same priority, they are lexicographically// sorted based on their network name, and the one that sorts first is picked.GwPriorityint// Operational dataNetworkIDstringEndpointIDstringGatewaystringIPAddressstringIPPrefixLenintIPv6GatewaystringGlobalIPv6AddressstringGlobalIPv6PrefixLenint// 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`
typeIPAM¶
type IPAM struct {DriverstringOptions map[string]string// Per network IPAM driver optionsConfig []IPAMConfig}IPAM represents IP Address Management
typeIPAMConfig¶
type IPAMConfig struct {Subnetstring `json:",omitempty"`IPRangestring `json:",omitempty"`Gatewaystring `json:",omitempty"`AuxAddress map[string]string `json:"AuxiliaryAddresses,omitempty"`}IPAMConfig represents IPAM configurations
typeInspect¶
type Inspect struct {Namestring// Name is the name of the networkIDstring `json:"Id"`// ID uniquely identifies a network on a single machineCreatedtime.Time// Created is the time the network createdScopestring// Scope describes the level at which the network exists (e.g. `swarm` for cluster-wide or `local` for machine level)Driverstring// Driver is the Driver name used to create the network (e.g. `bridge`, `overlay`)EnableIPv4bool// EnableIPv4 represents whether IPv4 is enabledEnableIPv6bool// EnableIPv6 represents whether IPv6 is enabledIPAMIPAM// IPAM is the network's IP Address ManagementInternalbool// Internal represents if the network is used internal onlyAttachablebool// Attachable represents if the global scope is manually attachable by regular containers from workers in swarm mode.Ingressbool// Ingress indicates the network is providing the routing-mesh for the swarm cluster.ConfigFromConfigReference// ConfigFrom specifies the source which will provide the configuration for this network.ConfigOnlybool// ConfigOnly networks are place-holder networks for network configurations to be used by other networks. ConfigOnly networks cannot be used directly to run containers or services.Containers map[string]EndpointResource// Containers contains endpoints belonging to the networkOptions map[string]string// Options holds the network specific options to use for when creating the networkLabels map[string]string// Labels holds metadata specific to the network being createdPeers []PeerInfo `json:",omitempty"`// List of peer nodes for an overlay networkServices map[string]ServiceInfo `json:",omitempty"`}Inspect is the body of the "get network" http response message.
typeInspectOptions¶
InspectOptions holds parameters to inspect network.
typeListOptions¶
ListOptions holds parameters to filter the list of networks with.
typeNetworkSubnet¶
type NetworkSubnet interface {// Contains checks whether the NetworkSubnet contains [addr].Contains(addrnet.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 anEndpointIPAMConfig is valid for a specific network.
typeNetworkingConfig¶
type NetworkingConfig struct {EndpointsConfig map[string]*EndpointSettings// Endpoint configs for each connecting network}NetworkingConfig represents the container's networking configuration for each of its interfacesCarries the networking configs specified in the `docker run` and `docker network connect` commands
typePruneReport¶
type PruneReport struct {NetworksDeleted []string}PruneReport contains the response for Engine API:POST "/networks/prune"
typeServiceInfo¶
ServiceInfo represents service parameters with the list of service's tasks