network

package
v0.0.0-...-d6da5a7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(networkName string, cinfo *container.ContainerInfo) error

func CreateNetwork

func CreateNetwork(driver, subnet, name string) error

func DeleteNetwork

func DeleteNetwork(networkName string) error

func Disconnect

func Disconnect(networkName string, cinfo *container.ContainerInfo) error

func Init

func Init() error

func ListNetwork

func ListNetwork()

对应docker network list 命令

Types

type Endpoint

type Endpoint struct {
	ID          string           `json:"id"`
	Device      netlink.Veth     `json:"dev"`
	IPAddress   net.IP           `json:"ip"`
	MacAddress  net.HardwareAddr `json:"mac"`
	Network     *Network
	PortMapping []string
}

type Network

type Network struct {
	Name    string     //网络名
	IpRange *net.IPNet //地址段
	Driver  string     //网络驱动名
}

type NetworkDriver

type NetworkDriver 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
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL