network

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Addr

func Addr(network *net.IPNet, index uint32) *net.IPNet

Addr returns nth address in the network.

func Join

func Join(ip *net.IPNet, exposedPorts []ExposedPort, pid int) (func() error, error)

Join adds container to the network.

func Random

func Random(prefix uint8) (*net.IPNet, func() error, error)

Random selects random available network.

func SetupContainer

func SetupContainer(ip *net.IPNet) error

SetupContainer sets up networking inside network namespace.

Types

type ExposedPort

type ExposedPort struct {
	Protocol     string
	ExternalIP   net.IP
	ExternalPort uint16
	InternalPort uint16
	Public       bool
}

ExposedPort defines a port to be exposed from the namespace.

Jump to

Keyboard shortcuts

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