github.com/zhuohuang-hust/src-cbuild@v0.0.0-20230105071821-c7aab3e7c840/api/server/router/network/backend.go (about)

     1  package network
     2  
     3  import (
     4  	"github.com/docker/docker/api/types"
     5  	"github.com/docker/docker/api/types/filters"
     6  	"github.com/docker/docker/api/types/network"
     7  	"github.com/docker/libnetwork"
     8  )
     9  
    10  // Backend is all the methods that need to be implemented
    11  // to provide network specific functionality.
    12  type Backend interface {
    13  	FindNetwork(idName string) (libnetwork.Network, error)
    14  	GetNetworkByName(idName string) (libnetwork.Network, error)
    15  	GetNetworksByID(partialID string) []libnetwork.Network
    16  	GetNetworks() []libnetwork.Network
    17  	CreateNetwork(nc types.NetworkCreateRequest) (*types.NetworkCreateResponse, error)
    18  	ConnectContainerToNetwork(containerName, networkName string, endpointConfig *network.EndpointSettings) error
    19  	DisconnectContainerFromNetwork(containerName string, networkName string, force bool) error
    20  	DeleteNetwork(name string) error
    21  	NetworksPrune(pruneFilters filters.Args) (*types.NetworksPruneReport, error)
    22  }