helpers

package
v1.2.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolPtr

func BoolPtr(p bool) *bool

BoolPtr converts the supplied bool to a pointer to that bool

func BoolValue

func BoolValue(v *bool) bool

BoolValue converts the supplied bool pointer to an bool, returning false if the pointer is nil.

func BoolValueOrDefault added in v1.2.0

func BoolValueOrDefault(v *bool, def bool) bool

BoolValueOrDefault sets eventually a default value for bool type.

func DeleteSecret

func DeleteSecret(ctx context.Context, k client.Client, ref *xpv1.SecretKeySelector) error

func GetSecret

func GetSecret(ctx context.Context, k client.Client, ref *xpv1.SecretKeySelector) (string, error)

func Int32OrDefault

func Int32OrDefault(i *int32, def int32) *int32

Int32OrDefault sets eventually a default value for int32 type.

func Int32Ptr

func Int32Ptr(p int32) *int32

Int32Ptr converts the supplied int32 to a pointer to that int32.

func Int32Value

func Int32Value(v *int32) int32

Int32Value converts the supplied int32 pointer to an int, returning zero if the pointer is nil.

func Int64OrDefault

func Int64OrDefault(i *int64, def int64) *int64

Int64OrDefault sets eventually a default value for int64 type.

func Int64Ptr

func Int64Ptr(p int64) *int64

Int64Ptr converts the supplied int64 to a pointer to that int64.

func Int64Value

func Int64Value(v *int64) int64

Int64Value converts the supplied int64 pointer to an int, returning zero if the pointer is nil.

func IntPtrValue

func IntPtrValue(ip *int, i int) int

IntPtrValue return the *int value or a default

func IsBoolPtrEqualToBool

func IsBoolPtrEqualToBool(bp *bool, b bool) bool

IsBoolPtrEqualToBool compares a *bool with bool

func IsIntEqualToIntPtr

func IsIntEqualToIntPtr(ip *int, i int) bool

IsIntEqualToIntPtr compares an *int with int

func LateInitializeBool

func LateInitializeBool(b *bool, from bool) *bool

LateInitializeBool implements late initialization for bool type.

func LateInitializeInt32

func LateInitializeInt32(i *int32, from int32) *int32

LateInitializeInt32 implements late initialization for int32 type.

func LateInitializeInt64

func LateInitializeInt64(i *int64, from int64) *int64

LateInitializeInt64 implements late initialization for int64 type.

func LateInitializeString

func LateInitializeString(s *string, from string) *string

LateInitializeString implements late initialization for string type.

func SetSecret

func SetSecret(ctx context.Context, k client.Client, ref *xpv1.SecretKeySelector, val string) error

func StringOrDefault

func StringOrDefault(s *string, def string) *string

StringOrDefault sets eventually a default value for string type.

func StringPtr

func StringPtr(p string) *string

StringPtr converts the supplied string to a pointer to that string.

func StringSliceContains

func StringSliceContains(s []string, str string) bool

StringSliceContains contains checks if a string is present in a slice.

func StringValue

func StringValue(v *string) string

StringValue converts the supplied string pointer to a string, returning the empty string if the pointer is nil.

Types

This section is empty.

Jump to

Keyboard shortcuts

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