types

package
v1.14.2 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNilMap               = errors.New("nil map")
	ErrUnknownNamedPort     = errors.New("unknown named port")
	ErrIncompatibleProtocol = errors.New("incompatible protocol")
	ErrNamedPortIsZero      = errors.New("named port is zero")
	ErrDuplicateNamedPorts  = errors.New("duplicate named ports")
)

Functions

func ValidatePortName

func ValidatePortName(name string) (string, error)

ValidatePortName checks that the port name conforms to the IANA Service Names spec and converts the port name to lower case for case-insensitive comparisons.

Types

type IPv4

type IPv4 [4]byte

IPv4 is the binary representation for encoding in binary structs.

func (IPv4) Addr

func (v4 IPv4) Addr() netip.Addr

func (*IPv4) DeepCopyInto

func (v4 *IPv4) DeepCopyInto(out *IPv4)

DeepCopyInto is a deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (IPv4) IP

func (v4 IPv4) IP() net.IP

func (IPv4) IsZero

func (v4 IPv4) IsZero() bool

func (IPv4) String

func (v4 IPv4) String() string

type IPv6

type IPv6 [16]byte

IPv6 is the binary representation for encoding in binary structs.

func (IPv6) Addr

func (v6 IPv6) Addr() netip.Addr

func (*IPv6) DeepCopyInto

func (v6 *IPv6) DeepCopyInto(out *IPv6)

DeepCopyInto is a deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (IPv6) IP

func (v6 IPv6) IP() net.IP

func (IPv6) String

func (v6 IPv6) String() string

type MACAddr

type MACAddr [6]byte

MACAddr is the binary representation for encoding in binary structs.

func (*MACAddr) DeepCopyInto

func (addr *MACAddr) DeepCopyInto(out *MACAddr)

DeepCopyInto is a deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (MACAddr) String

func (addr MACAddr) String() string

type NamedPortMap

type NamedPortMap map[string]PortProto

NamedPortMap maps port names to port numbers and protocols.

func (NamedPortMap) AddPort

func (npm NamedPortMap) AddPort(name string, port int, protocol string) error

AddPort adds a new PortProto to the NamedPortMap

func (NamedPortMap) GetNamedPort

func (npm NamedPortMap) GetNamedPort(name string, proto uint8) (uint16, error)

GetNamedPort returns the port number for the named port, if any.

type NamedPortMultiMap

type NamedPortMultiMap map[string]PortProtoSet

NamedPortMultiMap may have multiple entries for a name if multiple PODs define the same name with different values.

func (NamedPortMultiMap) Equal

func (npm NamedPortMultiMap) Equal(other NamedPortMultiMap) bool

Equal returns true if the NamedPortMultiMaps are equal.

func (NamedPortMultiMap) GetNamedPort

func (npm NamedPortMultiMap) GetNamedPort(name string, proto uint8) (uint16, error)

GetNamedPort returns the port number for the named port, if any.

type PortProto

type PortProto struct {
	Port  uint16 // non-0
	Proto uint8  // 0 for any
}

PortProto is a pair of port number and protocol and is used as the value type in named port maps.

type PortProtoSet

type PortProtoSet map[PortProto]struct{}

PortProtoSet is a set of unique PortProto values.

func (PortProtoSet) Equal

func (pps PortProtoSet) Equal(other PortProtoSet) bool

Equal returns true if the PortProtoSets are equal.

Jump to

Keyboard shortcuts

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