ports

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NetPort

type NetPort struct {
	Protocol string
	Port     int
}

NetPort is a pair of IP protocol name and port number.

func ParseNetPort

func ParseNetPort(s string) (NetPort, error)

ParseNetPort parses s as NetPort in a form like "80/tcp".

func (NetPort) MarshalYAML

func (np NetPort) MarshalYAML() (interface{}, error)

MarshalYAML implements yaml.Marshaler interface.

func (NetPort) String

func (np NetPort) String() string

String formats np as string in a form like "80/tcp".

func (*NetPort) UnmarshalYAML

func (np *NetPort) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements yaml.Unmarshaler interface.

type Set

type Set map[int]bool

Set represents a set of port numbers.

func (Set) Add

func (set Set) Add(port int)

Add adds a port number to set.

func (Set) Has

func (set Set) Has(port int) bool

Has returns true if set contains given port number.

Jump to

Keyboard shortcuts

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