Documentation ¶
Index ¶
- Constants
- func NewBridgeDriver(config *Configuration) *bridgeDriver
- func ParseIPv4(s string) (*net.IPNet, error)
- type Configuration
- type Driver
- func (d *Driver) AllocateNetwork(req *network.AllocateNetworkRequest) (res *network.AllocateNetworkResponse, err error)
- func (d *Driver) CreateEndpoint(req *network.CreateEndpointRequest) (res *network.CreateEndpointResponse, err error)
- func (d *Driver) CreateNetwork(req *network.CreateNetworkRequest) (err error)
- func (d *Driver) DeleteEndpoint(req *network.DeleteEndpointRequest) (err error)
- func (d *Driver) DeleteNetwork(req *network.DeleteNetworkRequest) (err error)
- func (d *Driver) DiscoverDelete(notif *network.DiscoveryNotification) (err error)
- func (d *Driver) DiscoverNew(notif *network.DiscoveryNotification) (err error)
- func (d *Driver) EndpointInfo(req *network.InfoRequest) (res *network.InfoResponse, err error)
- func (d *Driver) FreeNetwork(req *network.FreeNetworkRequest) (err error)
- func (d *Driver) GetCapabilities() (res *network.CapabilitiesResponse, err error)
- func (d *Driver) Join(req *network.JoinRequest) (res *network.JoinResponse, err error)
- func (d *Driver) Leave(req *network.LeaveRequest) (err error)
- func (d *Driver) ProgramExternalConnectivity(req *network.ProgramExternalConnectivityRequest) (err error)
- func (d *Driver) RevokeExternalConnectivity(req *network.RevokeExternalConnectivityRequest) (err error)
- type EndpointInterface
- type EndpointNotFoundError
- type ErrEndpointExists
- type ErrInvalidDriverConfig
- type ErrInvalidEndpointConfig
- type ErrInvalidGateway
- type ErrInvalidMtu
- type ErrInvalidTransportPortsOption
- type ErrNoNetwork
- type IPAMData
- type IPTableCfgError
- type InterfaceName
- type InvalidEndpointIDError
- type InvalidNetworkIDError
- type JoinResponse
- type StaticRoute
Constants ¶
const ( // DefaultGatewayV4AuxKey represents the default-gateway configured by the user DefaultGatewayV4AuxKey = "DefaultGatewayIPv4" // DefaultGatewayV6AuxKey represents the ipv6 default-gateway configured by the user DefaultGatewayV6AuxKey = "DefaultGatewayIPv6" )
Variables ¶
This section is empty.
Functions ¶
func NewBridgeDriver ¶
func NewBridgeDriver(config *Configuration) *bridgeDriver
NewBridgeDriver constructs a new bridge driver
Types ¶
type Configuration ¶
Configuration info for the "bridge" driver.
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
func (*Driver) AllocateNetwork ¶
func (d *Driver) AllocateNetwork(req *network.AllocateNetworkRequest) (res *network.AllocateNetworkResponse, err error)
func (*Driver) CreateEndpoint ¶
func (d *Driver) CreateEndpoint(req *network.CreateEndpointRequest) (res *network.CreateEndpointResponse, err error)
func (*Driver) CreateNetwork ¶
func (d *Driver) CreateNetwork(req *network.CreateNetworkRequest) (err error)
func (*Driver) DeleteEndpoint ¶
func (d *Driver) DeleteEndpoint(req *network.DeleteEndpointRequest) (err error)
func (*Driver) DeleteNetwork ¶
func (d *Driver) DeleteNetwork(req *network.DeleteNetworkRequest) (err error)
func (*Driver) DiscoverDelete ¶
func (d *Driver) DiscoverDelete(notif *network.DiscoveryNotification) (err error)
func (*Driver) DiscoverNew ¶
func (d *Driver) DiscoverNew(notif *network.DiscoveryNotification) (err error)
func (*Driver) EndpointInfo ¶
func (d *Driver) EndpointInfo(req *network.InfoRequest) (res *network.InfoResponse, err error)
func (*Driver) FreeNetwork ¶
func (d *Driver) FreeNetwork(req *network.FreeNetworkRequest) (err error)
func (*Driver) GetCapabilities ¶
func (d *Driver) GetCapabilities() (res *network.CapabilitiesResponse, err error)
func (*Driver) Join ¶
func (d *Driver) Join(req *network.JoinRequest) (res *network.JoinResponse, err error)
func (*Driver) ProgramExternalConnectivity ¶
func (d *Driver) ProgramExternalConnectivity(req *network.ProgramExternalConnectivityRequest) (err error)
ProgramExternalConnectivity is called after Join for non-internal networks to give external network access. Although this driver does not support external connectivity, it does not return an error because libnetwork will fail the endpoint initialization if any error is returned.
func (*Driver) RevokeExternalConnectivity ¶
func (d *Driver) RevokeExternalConnectivity(req *network.RevokeExternalConnectivityRequest) (err error)
RevokeExternalConnectivity is called bedore Leave when tearing down an endpoint to remove up external network access. As for ProgramExternalConnectivity, we return no error here, bt take no action.
type EndpointInterface ¶
type EndpointInterface struct { MacAddress net.HardwareAddr Address *net.IPNet AddressIPv6 *net.IPNet }
EndpointInterface contains information about an endpoint spanning a container boundary.
func ParseEndpointInterface ¶
func ParseEndpointInterface(in *network.EndpointInterface) (*EndpointInterface, error)
func (*EndpointInterface) Marshal ¶
func (e *EndpointInterface) Marshal() *network.EndpointInterface
type EndpointNotFoundError ¶
type EndpointNotFoundError string
EndpointNotFoundError is returned when the no endpoint with the passed endpoint id is found.
func (EndpointNotFoundError) Error ¶
func (enfe EndpointNotFoundError) Error() string
func (EndpointNotFoundError) NotFound ¶
func (enfe EndpointNotFoundError) NotFound()
NotFound denotes the type of this error
type ErrEndpointExists ¶
type ErrEndpointExists string
ErrEndpointExists is returned if more than one endpoint is added to the network
func (ErrEndpointExists) Error ¶
func (ee ErrEndpointExists) Error() string
func (ErrEndpointExists) Forbidden ¶
func (ee ErrEndpointExists) Forbidden()
Forbidden denotes the type of this error
type ErrInvalidDriverConfig ¶
type ErrInvalidDriverConfig struct{}
ErrInvalidDriverConfig error is returned when Bridge Driver is passed an invalid config
func (*ErrInvalidDriverConfig) BadRequest ¶
func (eidc *ErrInvalidDriverConfig) BadRequest()
BadRequest denotes the type of this error
func (*ErrInvalidDriverConfig) Error ¶
func (eidc *ErrInvalidDriverConfig) Error() string
type ErrInvalidEndpointConfig ¶
type ErrInvalidEndpointConfig struct{}
ErrInvalidEndpointConfig error is returned when an endpoint create is attempted with an invalid endpoint configuration.
func (*ErrInvalidEndpointConfig) BadRequest ¶
func (eiec *ErrInvalidEndpointConfig) BadRequest()
BadRequest denotes the type of this error
func (*ErrInvalidEndpointConfig) Error ¶
func (eiec *ErrInvalidEndpointConfig) Error() string
type ErrInvalidGateway ¶
type ErrInvalidGateway struct{}
ErrInvalidGateway is returned when the user provided default gateway (v4/v6) is not not valid.
func (*ErrInvalidGateway) BadRequest ¶
func (eig *ErrInvalidGateway) BadRequest()
BadRequest denotes the type of this error
func (*ErrInvalidGateway) Error ¶
func (eig *ErrInvalidGateway) Error() string
type ErrInvalidMtu ¶
type ErrInvalidMtu int
ErrInvalidMtu is returned when the user provided MTU is not valid.
func (ErrInvalidMtu) BadRequest ¶
func (eim ErrInvalidMtu) BadRequest()
BadRequest denotes the type of this error
func (ErrInvalidMtu) Error ¶
func (eim ErrInvalidMtu) Error() string
type ErrInvalidTransportPortsOption ¶
type ErrInvalidTransportPortsOption struct{}
ErrInvalidTransportPortsOption is returned when the driver recieves a request with a TransportPorts key that could not be decoded.
func (*ErrInvalidTransportPortsOption) BadRequest ¶
func (eitp *ErrInvalidTransportPortsOption) BadRequest()
BadRequest denotes the type of this error
func (*ErrInvalidTransportPortsOption) Error ¶
func (eitp *ErrInvalidTransportPortsOption) Error() string
type ErrNoNetwork ¶
type ErrNoNetwork string
ErrNoNetwork is returned if no network with the specified id exists
func (ErrNoNetwork) Error ¶
func (enn ErrNoNetwork) Error() string
func (ErrNoNetwork) NotFound ¶
func (enn ErrNoNetwork) NotFound()
NotFound denotes the type of this error
type IPAMData ¶
type IPAMData struct { AddressSpace string Pool *net.IPNet Gateway *net.IPNet AuxAddresses map[string]*net.IPNet }
IPAMData contains IPv4 or IPv6 addressing information.
type IPTableCfgError ¶
type IPTableCfgError string
IPTableCfgError is returned when an unexpected ip tables configuration is entered
func (IPTableCfgError) BadRequest ¶
func (name IPTableCfgError) BadRequest()
BadRequest denotes the type of this error
func (IPTableCfgError) Error ¶
func (name IPTableCfgError) Error() string
type InterfaceName ¶
type InterfaceName network.InterfaceName
Interface name specifies naming for an endpoint in and out of the container.
type InvalidEndpointIDError ¶
type InvalidEndpointIDError string
InvalidEndpointIDError is returned when the passed endpoint id is not valid.
func (InvalidEndpointIDError) BadRequest ¶
func (ieie InvalidEndpointIDError) BadRequest()
BadRequest denotes the type of this error
func (InvalidEndpointIDError) Error ¶
func (ieie InvalidEndpointIDError) Error() string
type InvalidNetworkIDError ¶
type InvalidNetworkIDError string
InvalidNetworkIDError is returned when the passed network id for an existing network is not a known id.
func (InvalidNetworkIDError) Error ¶
func (inie InvalidNetworkIDError) Error() string
func (InvalidNetworkIDError) NotFound ¶
func (inie InvalidNetworkIDError) NotFound()
NotFound denotes the type of this error
type JoinResponse ¶
type JoinResponse struct { InterfaceName InterfaceName Gateway net.IP GatewayIPv6 net.IP StaticRoutes []*StaticRoute DisableGatewayService bool }
Join response contains settins that can be established by the driver when a container joins a network.
func (*JoinResponse) Marshal ¶
func (j *JoinResponse) Marshal() *network.JoinResponse
type StaticRoute ¶
StaticRoute contains static route information set during a Join.
func (*StaticRoute) Marshal ¶
func (s *StaticRoute) Marshal() *network.StaticRoute