utils

package
v1.5.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

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 added in v1.0.0

func DefaultBooleanIfUnset(valPtr **bool, d bool)

DefaultBooleanIfUnset sets default value d of a boolean if unset

func DefaultInt32IfUnset added in v1.0.0

func DefaultInt32IfUnset(valPtr **int32, d int32)

DefaultInt32IfUnset sets default value d of an int32 if unset

func DefaultIntIfUnset added in v1.0.0

func DefaultIntIfUnset(ptr **int, val int)

DefaultIntIfUnset sets value val of an int if unset

func DefaultStringIfUnset added in v1.0.0

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 interface{}, cmp interface{}) 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 NewBoolPointer

func NewBoolPointer(b bool) *bool

NewBoolPointer returns pointer on a new bool value instance

func NewInt32Pointer

func NewInt32Pointer(i int32) *int32

NewInt32Pointer returns pointer on a new int32 value instance

func NewInt64Pointer

func NewInt64Pointer(i int64) *int64

NewInt64Pointer returns pointer on a new int32 value instance

func NewIntPointer added in v1.0.0

func NewIntPointer(i int) *int

NewIntPointer returns pointer to an int value

func NewStringPointer

func NewStringPointer(s string) *string

NewStringPointer returns pointer on a new string value instance

func YAMLToJSONString added in v1.0.0

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