backend.go 716 B

123456789101112131415161718192021
  1. package network
  2. import (
  3. "github.com/docker/docker/api/types/network"
  4. "github.com/docker/libnetwork"
  5. )
  6. // Backend is all the methods that need to be implemented to provide
  7. // network specific functionality
  8. type Backend interface {
  9. FindNetwork(idName string) (libnetwork.Network, error)
  10. GetNetwork(idName string, by int) (libnetwork.Network, error)
  11. GetNetworksByID(partialID string) []libnetwork.Network
  12. CreateNetwork(name, driver string, ipam network.IPAM,
  13. options map[string]string) (libnetwork.Network, error)
  14. ConnectContainerToNetwork(containerName, networkName string) error
  15. DisconnectContainerFromNetwork(containerName string,
  16. network libnetwork.Network) error
  17. NetworkControllerEnabled() bool
  18. }