utils

package
v1.2.13 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllocateIPv4s added in v1.2.13

func AllocateIPv4s(cidr string, ipStart int, count int) ([]string, string, error)

allocateIPv4s returns count IPs starting at host offset ipStart within cidr. It enforces: IPv4, ipStart>=1, and avoids network/broadcast addresses for typical subnets.

func ChangePortNumber added in v1.2.9

func ChangePortNumber(address, newPort string) string

func ContainsString

func ContainsString(slice []string, s string) bool

ContainsString checks if a string is present in a slice.

func DefaultIfEmpty added in v1.2.10

func DefaultIfEmpty(val, def string) string

func GenerateHash

func GenerateHash(obj runtime.Object) string

func GenerateLPMNetworkName added in v1.2.13

func GenerateLPMNetworkName(overlayName string) string

func GenerateReplicaSetName added in v1.2.13

func GenerateReplicaSetName(switchPodName string) string

func GenerateServiceName added in v1.2.9

func GenerateServiceName(switchPodName string) string

func GenerateSwitchPodName added in v1.2.13

func GenerateSwitchPodName(resourceName, nodeName string, switchType SwitchType) string

func GetPortNumberFromNetAttachDef

func GetPortNumberFromNetAttachDef(netAttachName string) (string, error)

GetPortNumberFromNetAttachDef extracts the port number from the network attachment name.

func Int32Ptr

func Int32Ptr(i int32) *int32

func RemoveString

func RemoveString(slice []string, s string) []string

RemoveString removes a string from a slice.

func SpecToJson

func SpecToJson(obj runtime.Object) bytes.Buffer

Types

type SwitchType added in v1.2.13

type SwitchType string
const (
	SlicePacketSwitch SwitchType = "sps"
	NetworkEdgeDevice SwitchType = "ned"
)

Jump to

Keyboard shortcuts

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