Documentation ¶
Index ¶
- func Connect(networkName string, cInfo *container.Info) error
- func CreateNetwork(driver, subnet, name string) error
- func DeleteNetwork(networkName string) error
- func Disconnect(networkName string, cinfo *container.Info) error
- func Init() error
- func ListNetwork()
- type BridgeNetworkDriver
- func (d *BridgeNetworkDriver) Connect(network *Network, endpoint *Endpoint) error
- func (d *BridgeNetworkDriver) Create(subnet string, name string) (*Network, error)
- func (d *BridgeNetworkDriver) Delete(network Network) error
- func (d *BridgeNetworkDriver) Disconnect(network Network, endpoint *Endpoint) error
- func (d *BridgeNetworkDriver) Name() string
- type Driver
- type Endpoint
- type IPAM
- type Network
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BridgeNetworkDriver ¶
type BridgeNetworkDriver struct { }
func (*BridgeNetworkDriver) Connect ¶
func (d *BridgeNetworkDriver) Connect(network *Network, endpoint *Endpoint) error
连接一个网络和网络端点
func (*BridgeNetworkDriver) Create ¶
func (d *BridgeNetworkDriver) Create(subnet string, name string) (*Network, error)
创建网络
func (*BridgeNetworkDriver) Delete ¶
func (d *BridgeNetworkDriver) Delete(network Network) error
删除网络对应的 Linux Bridge
func (*BridgeNetworkDriver) Disconnect ¶
func (d *BridgeNetworkDriver) Disconnect(network Network, endpoint *Endpoint) error
func (*BridgeNetworkDriver) Name ¶
func (d *BridgeNetworkDriver) Name() string
type Driver ¶
type Driver interface { // 驱动名 Name() string // 创始网络 Create(subnet string, name string) (*Network, error) // 删除网络 Delete(network Network) error // 连接容#苦网络端点到网络 Connect(network *Network, endpoint *Endpoint) error // 从网络上移除容器网络端点 Disconnect(network Network, endpoint *Endpoint) error }
网络驱动
type Endpoint ¶
type Endpoint struct { ID string `json:"id"` // 网络ID Device netlink.Veth `json:"dev"` // Veth 设备 IPAddress net.IP `json:"ip"` // IP 地址 MacAddress net.HardwareAddr `json:"mac"` // MAC 地址 Network *Network // 连接的容器和网络 PortMapping []string // 端口映射 }
网络端点
Click to show internal directories.
Click to hide internal directories.