helpers

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolOrDefault

func BoolOrDefault(b *bool, def bool) *bool

BoolOrDefault sets eventually a default value for bool type.

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 DeleteConfigMapValue

func DeleteConfigMapValue(ctx context.Context, kc client.Client, ref ConfigMapKeySelector) error

func DeleteSecretValue

func DeleteSecretValue(ctx context.Context, kc client.Client, ref SecretKeySelector) error

func GetConfigMapValue

func GetConfigMapValue(ctx context.Context, k client.Client, ref ConfigMapKeySelector) (string, error)

func GetSecretValue

func GetSecretValue(ctx context.Context, kc client.Client, ref 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 IntPtr

func IntPtr(p int) *int

IntPtr converts the supplied int to a pointer to that int.

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 SetConfigMapValue

func SetConfigMapValue(ctx context.Context, kc client.Client, ref ConfigMapKeySelector, val string) error

func SetSecretValue

func SetSecretValue(ctx context.Context, kc client.Client, ref 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

type ConfigMapKeySelector

type ConfigMapKeySelector struct {
	// Name of the configmap.
	Name string

	// Namespace of the configmap.
	Namespace string

	// The key to select.
	Key string
}

A ConfigMapKeySelector is a reference to a configmap key in an arbitrary namespace.

func (ConfigMapKeySelector) String

func (s ConfigMapKeySelector) String() string

type SecretKeySelector

type SecretKeySelector struct {
	// Name of the secret.
	Name string

	// Namespace of the secret.
	Namespace string

	// The key to select.
	Key string
}

A SecretKeySelector is a reference to a secret key in an arbitrary namespace.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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