utils

package
v0.0.0-...-f07a332 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 5 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolToString

func BoolToString(b *bool) string

BoolToString return "true" if b == true, else "false"

func BoolValue

func BoolValue(b *bool) bool

BoolValue return the boolean value, false if nil

func DefaultBooleanIfUnset

func DefaultBooleanIfUnset(valPtr **bool, d bool)

DefaultBooleanIfUnset sets default value d of a boolean if unset

func DefaultInt32IfUnset

func DefaultInt32IfUnset(valPtr **int32, d int32)

DefaultInt32IfUnset sets default value d of an int32 if unset

func DefaultIntIfUnset

func DefaultIntIfUnset(ptr **int, val int)

DefaultIntIfUnset sets value val of an int if unset

func DefaultStringIfUnset

func DefaultStringIfUnset(valPtr **string, d string)

DefaultStringIfUnset sets default value d of a string if unset

func GenerateRandomString

func GenerateRandomString(n int) string

GenerateRandomString use to generate random string with a define size

func IsEqualStruct

func IsEqualStruct(in any, cmp any) bool

IsEqualStruct is a util function that returns whether 2 structures are the same We compare the marshaled results to avoid traversing all fields and be agnostic of the struct.

func NewIntOrStringPointer

func NewIntOrStringPointer(str string) *intstr.IntOrString

NewIntOrStringPointer converts a string value to an IntOrString pointer

func StringValue

func StringValue(s *string) string

StringValue return the string value, "" if nil

func YAMLToJSONString

func YAMLToJSONString(yamlConfigs string) string

YAMLToJSONString converts a YAML string to a JSON string

Types

This section is empty.

Jump to

Keyboard shortcuts

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