Documentation
¶
Index ¶
- Constants
- func ConfigureHandler(sdkhandler sdk.Handler, driver Driver)
- type AllocateNetworkRequest
- type AllocateNetworkResponse
- type CapabilitiesResponse
- type CapabilitiesResponseScope
- type CreateEndpointRequest
- type CreateEndpointResponse
- type CreateNetworkRequest
- type CreateNetworkRequestOptions
- type DeleteEndpointRequest
- type DeleteNetworkRequest
- type DiscoveryNotification
- type Driver
- type EndpointInterface
- type FreeNetworkRequest
- type Handler
- type IPAMData
- type InfoRequest
- type InfoResponse
- type InterfaceName
- type JoinRequest
- type JoinResponse
- type LeaveRequest
- type ProgramExternalConnectivityRequest
- type RevokeExternalConnectivityRequest
- type StaticRoute
Constants ¶
const ( // ImplementationName is the name of the interface all network plugins implement ImplementationName sdk.DriverImplementationName = "NetworkDriver" )
Variables ¶
This section is empty.
Functions ¶
func ConfigureHandler ¶
ConfigureHandler adds routes to the sdk.Handler to handle the network plugin API
Types ¶
type AllocateNetworkRequest ¶
type AllocateNetworkRequest struct {
// A network ID that remote plugins are expected to store for future
// reference.
NetworkID string
// A free form map->object interface for communication of options.
Options map[string]string
// IPAMData contains the address pool information for this network
IPv4Data, IPv6Data []IPAMData
}
AllocateNetworkRequest requests allocation of new network by manager
type AllocateNetworkResponse ¶
type AllocateNetworkResponse struct {
// A free form plugin specific string->string object to be sent in
// CreateNetworkRequest call in the libnetwork agents
Options map[string]string
}
AllocateNetworkResponse is the response to the AllocateNetworkRequest.
type CapabilitiesResponse ¶
type CapabilitiesResponse struct {
Scope CapabilitiesResponseScope
ConnectivityScope CapabilitiesResponseScope
GwAllocChecker bool
}
CapabilitiesResponse returns whether or not this network is global or local
type CapabilitiesResponseScope ¶ added in v2.1.0
type CapabilitiesResponseScope string
const ( // LocalScope is the correct scope response for a local scope driver LocalScope CapabilitiesResponseScope = "local" // GlobalScope is the correct scope response for a global scope driver GlobalScope CapabilitiesResponseScope = "global" )
type CreateEndpointRequest ¶
type CreateEndpointRequest struct {
NetworkID string
EndpointID string
Interface *EndpointInterface
Options map[string]interface{}
}
CreateEndpointRequest is sent by the daemon when an endpoint should be created
type CreateEndpointResponse ¶
type CreateEndpointResponse struct {
Interface *EndpointInterface
}
CreateEndpointResponse is sent as a response to a CreateEndpointRequest
type CreateNetworkRequest ¶
type CreateNetworkRequest struct {
NetworkID string
Options CreateNetworkRequestOptions
IPv4Data []*IPAMData
IPv6Data []*IPAMData
}
CreateNetworkRequest is sent by the daemon when a network needs to be created
type CreateNetworkRequestOptions ¶ added in v2.1.0
type DeleteEndpointRequest ¶
DeleteEndpointRequest is sent by the daemon when an endpoint needs to be removed
type DeleteNetworkRequest ¶
type DeleteNetworkRequest struct {
NetworkID string
}
DeleteNetworkRequest is sent by the daemon when a network needs to be removed
type DiscoveryNotification ¶
type DiscoveryNotification struct {
DiscoveryType int
DiscoveryData interface{}
}
DiscoveryNotification is sent by the daemon when a new discovery event occurs
type Driver ¶
type Driver interface {
// GetCapabilities returns the driver capabilities
// https://github.com/moby/moby/blob/master/libnetwork/docs/remote.md#set-capability
GetCapabilities(context.Context) (*CapabilitiesResponse, error)
CreateNetwork(context.Context, *CreateNetworkRequest) error
AllocateNetwork(context.Context, *AllocateNetworkRequest) (*AllocateNetworkResponse, error)
DeleteNetwork(context.Context, *DeleteNetworkRequest) error
FreeNetwork(context.Context, *FreeNetworkRequest) error
CreateEndpoint(context.Context, *CreateEndpointRequest) (*CreateEndpointResponse, error)
DeleteEndpoint(context.Context, *DeleteEndpointRequest) error
EndpointInfo(context.Context, *InfoRequest) (*InfoResponse, error)
Join(context.Context, *JoinRequest) (*JoinResponse, error)
Leave(context.Context, *LeaveRequest) error
DiscoverNew(context.Context, *DiscoveryNotification) error
DiscoverDelete(context.Context, *DiscoveryNotification) error
ProgramExternalConnectivity(context.Context, *ProgramExternalConnectivityRequest) error
RevokeExternalConnectivity(context.Context, *RevokeExternalConnectivityRequest) error
}
Driver represent the interface a driver must fulfill.
type EndpointInterface ¶
EndpointInterface contains endpoint interface information
type FreeNetworkRequest ¶
type FreeNetworkRequest struct {
// The ID of the network to be freed.
NetworkID string
}
FreeNetworkRequest is the request to free allocated network in the manager
type Handler ¶
Handler forwards requests and responses between the docker daemon and the plugin.
func NewHandler ¶
func NewHandler(logger logrus.FieldLogger, driver Driver) *Handler
NewHandler initializes the request handler with a driver implementation.
type IPAMData ¶
type IPAMData struct {
AddressSpace string
Pool string
Gateway string
AuxAddresses map[string]interface{}
}
IPAMData contains IPv4 or IPv6 addressing information
type InfoRequest ¶
InfoRequest is send by the daemon when querying endpoint information
type InfoResponse ¶
InfoResponse is endpoint information sent in response to an InfoRequest
type InterfaceName ¶
InterfaceName consists of the name of the interface in the global netns and the desired prefix to be appended to the interface inside the container netns
type JoinRequest ¶
type JoinRequest struct {
NetworkID string
EndpointID string
SandboxKey string
Options map[string]interface{}
}
JoinRequest is sent by the Daemon when an endpoint needs be joined to a network
type JoinResponse ¶
type JoinResponse struct {
InterfaceName InterfaceName
Gateway string
GatewayIPv6 string
StaticRoutes []*StaticRoute
DisableGatewayService bool
}
JoinResponse is sent in response to a JoinRequest
type LeaveRequest ¶
LeaveRequest is send by the daemon when a endpoint is leaving a network
type ProgramExternalConnectivityRequest ¶
type ProgramExternalConnectivityRequest struct {
NetworkID string
EndpointID string
Options map[string]interface{}
}
ProgramExternalConnectivityRequest specifies the L4 data and the endpoint for which programming has to be done
type RevokeExternalConnectivityRequest ¶
RevokeExternalConnectivityRequest specifies the endpoint for which the L4 programming has to be removed
type StaticRoute ¶
StaticRoute contains static route information