package nat

import "github.com/docker/docker/nat"

Index

Constants

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

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 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{}

Source Files

nat.go sort.go

Version
v1.3.0
Published
Oct 15, 2014
Platform
js/wasm
Imports
6 packages
Last checked
5 minutes ago

Tools for package owners.