github.com/moby/docker@v26.1.3+incompatible/api/types/network/network.go (about)

     1  package network // import "github.com/docker/docker/api/types/network"
     2  
     3  import (
     4  	"github.com/docker/docker/api/types/filters"
     5  )
     6  
     7  const (
     8  	// NetworkDefault is a platform-independent alias to choose the platform-specific default network stack.
     9  	NetworkDefault = "default"
    10  	// NetworkHost is the name of the predefined network used when the NetworkMode host is selected (only available on Linux)
    11  	NetworkHost = "host"
    12  	// NetworkNone is the name of the predefined network used when the NetworkMode none is selected (available on both Linux and Windows)
    13  	NetworkNone = "none"
    14  	// NetworkBridge is the name of the default network on Linux
    15  	NetworkBridge = "bridge"
    16  	// NetworkNat is the name of the default network on Windows
    17  	NetworkNat = "nat"
    18  )
    19  
    20  // Address represents an IP address
    21  type Address struct {
    22  	Addr      string
    23  	PrefixLen int
    24  }
    25  
    26  // PeerInfo represents one peer of an overlay network
    27  type PeerInfo struct {
    28  	Name string
    29  	IP   string
    30  }
    31  
    32  // Task carries the information about one backend task
    33  type Task struct {
    34  	Name       string
    35  	EndpointID string
    36  	EndpointIP string
    37  	Info       map[string]string
    38  }
    39  
    40  // ServiceInfo represents service parameters with the list of service's tasks
    41  type ServiceInfo struct {
    42  	VIP          string
    43  	Ports        []string
    44  	LocalLBIndex int
    45  	Tasks        []Task
    46  }
    47  
    48  // NetworkingConfig represents the container's networking configuration for each of its interfaces
    49  // Carries the networking configs specified in the `docker run` and `docker network connect` commands
    50  type NetworkingConfig struct {
    51  	EndpointsConfig map[string]*EndpointSettings // Endpoint configs for each connecting network
    52  }
    53  
    54  // ConfigReference specifies the source which provides a network's configuration
    55  type ConfigReference struct {
    56  	Network string
    57  }
    58  
    59  var acceptedFilters = map[string]bool{
    60  	"dangling": true,
    61  	"driver":   true,
    62  	"id":       true,
    63  	"label":    true,
    64  	"name":     true,
    65  	"scope":    true,
    66  	"type":     true,
    67  }
    68  
    69  // ValidateFilters validates the list of filter args with the available filters.
    70  func ValidateFilters(filter filters.Args) error {
    71  	return filter.Validate(acceptedFilters)
    72  }