numorstring

package
v1.18.10 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

package numorstring is copied from libcalico-go so that we can convert felix env vars which map to felixconfiguration fields of type numorstring.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Port

type Port struct {
	MinPort  uint16 `json:"minPort,omitempty"`
	MaxPort  uint16 `json:"maxPort,omitempty"`
	PortName string `json:"portName" validate:"omitempty,portName"`
}

Port represents either a range of numeric ports or a named port.

  • For a named port, set the PortName, leaving MinPort and MaxPort as 0.
  • For a port range, set MinPort and MaxPort to the (inclusive) port numbers. Set PortName to "".
  • For a single port, set MinPort = MaxPort and PortName = "".

func NamedPort

func NamedPort(name string) Port

func PortFromRange

func PortFromRange(minPort, maxPort uint16) (Port, error)

PortFromRange creates a Port struct representing a range of ports.

func PortFromString

func PortFromString(s string) (Port, error)

PortFromString creates a Port struct from its string representation. A port may either be single value "1234", a range of values "100:200" or a named port: "name".

func SinglePort

func SinglePort(port uint16) Port

SinglePort creates a Port struct representing a single port.

Jump to

Keyboard shortcuts

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