nat

package
v1.7.0-rc4 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2015 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PortSpecTemplate       = "ip:hostPort:containerPort"
	PortSpecTemplateFormat = "ip:hostPort:containerPort | ip::containerPort | hostPort:containerPort | containerPort"
)

Variables

This section is empty.

Functions

func ParsePort

func ParsePort(rawPort string) (int, error)

func ParsePortSpecs

func ParsePortSpecs(ports []string) (map[Port]struct{}, map[Port][]PortBinding, error)

We will receive port specs in the format of ip:public:private/proto and these need to be parsed in the internal types

func Sort

func Sort(ports []Port, predicate func(i, j Port) bool)

func SortPortMap added in v1.7.0

func SortPortMap(ports []Port, bindings PortMap)

SortPortMap sorts the list of ports and their respected mapping. The ports will explicit HostPort will be placed first.

func SplitProtoPort

func SplitProtoPort(rawPort string) (string, string)

Splits a port in the format of proto/port

Types

type Port

type Port string

80/tcp

func NewPort

func NewPort(proto, port string) Port

func (Port) Int

func (p Port) Int() int

func (Port) Port

func (p Port) Port() string

func (Port) Proto

func (p Port) Proto() string

type PortBinding

type PortBinding struct {
	HostIp   string
	HostPort string
}

type PortMap

type PortMap map[Port][]PortBinding

type PortSet

type PortSet map[Port]struct{}

Jump to

Keyboard shortcuts

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