utils

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckNotEmpty added in v0.6.0

func CheckNotEmpty(name, input string) error

func DeepCopyStringSlice added in v0.5.0

func DeepCopyStringSlice(in []string) []string

func DeepEqualStringSlice added in v0.4.0

func DeepEqualStringSlice(a []string, b []string) bool

func Intersect added in v0.3.0

func Intersect(rangeA *networkingv1.AddressRange, rangeB *networkingv1.AddressRange) bool

Intersect returns if ip address range of rangeA is overlapped with rangeB.

func LastIP added in v0.3.0

func LastIP(subnet *net.IPNet) net.IP

LastIP Determine the last IP of a subnet, excluding the broadcast if IPv4

func MinUint32 added in v0.6.0

func MinUint32(a, b uint32) uint32

func NextIP added in v0.6.0

func NextIP(ip net.IP) net.IP

NextIP returns IP incremented by 1

func NormalizedIP

func NormalizedIP(ip string) string

NormalizedIP If IP is valid, return itself otherwise empty string

func ParseBoolOrDefault

func ParseBoolOrDefault(in string, defaultValue bool) bool

func PickFirstNonEmptyString

func PickFirstNonEmptyString(ss ...string) string

func StringSliceToMap

func StringSliceToMap(in []string) (out map[string]struct{})

func StringToIPNet

func StringToIPNet(in string) *net.IPNet

func ToDNSFormat added in v0.5.0

func ToDNSFormat(ip net.IP) string

func ValidateIP added in v0.6.0

func ValidateIP(ip string) error

func ValidateIPv4 added in v0.6.0

func ValidateIPv4(ip string) error

func ValidateIPv6 added in v0.6.0

func ValidateIPv6(ip string) error

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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