util

package
v0.19.8 Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetItems added in v0.17.3

func GetItems(list client.ObjectList) []client.Object

this is an ugly function to retrieve the list of Items from a client.ObjectList because the interface doesn't have a GetItems method

func Hash added in v0.12.0

func Hash(o interface{}) string

Hash returns a hash of the passed object

func IntStrPtr

func IntStrPtr(value intstr.IntOrString) *intstr.IntOrString

func MergeMaps added in v0.12.0

func MergeMaps(base map[string]string, merges ...map[string]string) map[string]string

MergeMaps merges a list maps into the first one. B overrides A if keys collide.

func Metav1DurationPtr added in v0.18.0

func Metav1DurationPtr(value time.Duration) *metav1.Duration

func ObjectKey added in v0.13.0

func ObjectKey(o client.Object) types.NamespacedName

func Unique added in v0.18.0

func Unique(stringSlice []string) []string

func WrapError added in v0.12.0

func WrapError(context string, err error) error

WrapError can be used to provide information about the context where the error occured

Types

type LogConfig added in v0.14.0

type LogConfig struct {
	LogMode      string `envconfig:"LOG_MODE" default:"production"`
	LogEncoding  string `envconfig:"LOG_ENCODING"`
	LogLevel     string `envconfig:"LOG_LEVEL"`
	LogVerbosity int8   `envconfig:"LOG_VERBOSITY" default:"0"`
}

type Logger added in v0.14.0

type Logger struct {
	// contains filtered or unexported fields
}

func (Logger) New added in v0.14.0

func (l Logger) New() logr.Logger

New will return a Logger configured with the LOG_* environment variables and the supported --zap* flags passed to the operator command line

type MultiError added in v0.13.0

type MultiError []error

Type MultiError can be used for iterative operations that must keep going even if errors are detected. It will return the list of all encountered errors. MultiError implements the Error interface and can be passed around as a normal error.

func (MultiError) Error added in v0.13.0

func (me MultiError) Error() string

type ProfilerConfig added in v0.14.0

type ProfilerConfig struct {
	EnableProfiler      bool   `envconfig:"PROFILER_ENABLE" default:"false"`
	ProfilerBindAddress string `envconfig:"PROFILER_BIND_ADDRESS" default:"0.0.0.0"`
	ProfilerBinbPort    string `envconfig:"PROFILER_BIND_ORT" default:"6060"`
	Log                 logr.Logger
}

func (ProfilerConfig) Setup added in v0.14.0

func (cfg ProfilerConfig) Setup() error

Jump to

Keyboard shortcuts

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