2015-10-26 14:47:48 -07:00
|
|
|
package network
|
|
|
|
|
|
|
|
import (
|
2016-03-28 13:41:06 -04:00
|
|
|
"github.com/docker/engine-api/types"
|
2016-01-04 19:05:26 -05:00
|
|
|
"github.com/docker/engine-api/types/network"
|
2015-10-26 14:47:48 -07:00
|
|
|
"github.com/docker/libnetwork"
|
|
|
|
)
|
|
|
|
|
2015-12-30 18:20:41 +01:00
|
|
|
// Backend is all the methods that need to be implemented
|
|
|
|
// to provide network specific functionality.
|
2015-10-26 14:47:48 -07:00
|
|
|
type Backend interface {
|
|
|
|
FindNetwork(idName string) (libnetwork.Network, error)
|
2015-12-30 18:20:41 +01:00
|
|
|
GetNetworkByName(idName string) (libnetwork.Network, error)
|
2015-10-26 14:47:48 -07:00
|
|
|
GetNetworksByID(partialID string) []libnetwork.Network
|
2016-06-13 19:52:49 -07:00
|
|
|
GetNetworks() []libnetwork.Network
|
2016-04-13 10:33:46 +02:00
|
|
|
CreateNetwork(nc types.NetworkCreateRequest) (*types.NetworkCreateResponse, error)
|
2016-01-07 16:18:34 -08:00
|
|
|
ConnectContainerToNetwork(containerName, networkName string, endpointConfig *network.EndpointSettings) error
|
2015-12-30 18:20:41 +01:00
|
|
|
DisconnectContainerFromNetwork(containerName string, network libnetwork.Network, force bool) error
|
2015-12-21 23:35:30 -05:00
|
|
|
DeleteNetwork(name string) error
|
2015-10-26 14:47:48 -07:00
|
|
|
}
|