network

package
v0.0.0-...-ac6e8c9 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidExposedPort = errors.New("invalid exposed port")

Functions

func GetRandomPort

func GetRandomPort() (int, error)

GetRandomPort returns a random (host) port if it finds one.

Types

type ExposedPort

type ExposedPort struct {
	Proto     string
	HostAddr  string
	HostPort  int
	GuestAddr string
	GuestPort int
}

func ParseExposedPorts

func ParseExposedPorts(exposedPorts map[string]struct{}) ([]ExposedPort, error)

ParseExposedPorts parses the exposed ports listed in an image configuration and returns a list of exposed ports.

If the configuration is invalid, an error will be returned.

func (ExposedPort) String

func (p ExposedPort) String() string

String returns a human-readable representation of an exposed port.

type Slirp4netns

type Slirp4netns struct {
	// contains filtered or unexported fields
}

func NewSlirp4netns

func NewSlirp4netns(pid int, socketPath string) (*Slirp4netns, error)

func (*Slirp4netns) ExposePorts

func (s *Slirp4netns) ExposePorts(ports []ExposedPort) error

func (*Slirp4netns) Start

func (s *Slirp4netns) Start() (int, error)

type Slirp4netnsCommand

type Slirp4netnsCommand struct {
	Execute string                 `json:"execute"`
	Args    map[string]interface{} `json:"arguments,omitempty"`
}

Jump to

Keyboard shortcuts

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