tools

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2025 License: Apache-2.0 Imports: 19 Imported by: 1

Documentation

Index

Constants

View Source
const (
	CredentialsSecretKey = "credentials"
	ParametersSecretKey  = "parameters"
)

Variables

This section is empty.

Functions

func CompareTimePtr added in v0.13.0

func CompareTimePtr(t1, t2 *time.Time) int

func EmptyOrContains added in v0.13.0

func EmptyOrContains[S ~[]E, E comparable](elements S, e E) bool

func FromCredentialsSecretData added in v0.14.0

func FromCredentialsSecretData(data map[string][]byte) (map[string]any, error)

func FromParametersSecretData added in v0.14.0

func FromParametersSecretData(data map[string][]byte) (map[string]any, error)

func LoadConfigInto

func LoadConfigInto(conf any, fromDir string) error

func NamespacedUUID added in v0.13.0

func NamespacedUUID(ns string, segments ...string) string

func NewZapLogger added in v0.7.0

func NewZapLogger(logLevel zapcore.Level) (logr.Logger, zap.AtomicLevel, error)

func NilOrEquals added in v0.13.0

func NilOrEquals[E comparable](value *E, expectedValue E) bool

func ParseDuration

func ParseDuration(dur string) (time.Duration, error)

func PtrTo

func PtrTo[T any](o T) *T

func SetMapValue added in v0.14.0

func SetMapValue[K comparable, V any](m map[K]V, key K, value V) map[K]V

func SyncLogLevel added in v0.7.0

func SyncLogLevel(ctx context.Context, logger logr.Logger, eventChan chan string, atomicLevel zap.AtomicLevel, getLogLevelFromPath LogLevelGetter)

func ToCredentialsSecretData added in v0.13.0

func ToCredentialsSecretData(credentials any) (map[string][]byte, error)

func ToParametersSecretData added in v0.14.0

func ToParametersSecretData(credentials any) (map[string][]byte, error)

func Uniq added in v0.13.0

func Uniq[S ~[]E, E cmp.Ordered](elements S) S

func WatchForConfigChangeEvents added in v0.7.0

func WatchForConfigChangeEvents(ctx context.Context, configFilePath string, logger logr.Logger, eventChan chan string) error

func ZeroIfNil added in v0.13.0

func ZeroIfNil[T any, PT *T](value PT) T

func ZeroOrEquals added in v0.14.0

func ZeroOrEquals[E comparable](value E, expectedValue E) bool

Types

type LogLevelGetter added in v0.7.0

type LogLevelGetter func(string) (zapcore.Level, error)

type LogrWriter added in v0.5.0

type LogrWriter struct {
	Logger  logr.Logger
	Message string
}

LogrWriter implements io.Writer and converts Write calls to logr.Logger.Error() calls

func (*LogrWriter) Write added in v0.5.0

func (w *LogrWriter) Write(msg []byte) (int, error)

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.
k8s
fake
Code generated by counterfeiter.
Code generated by counterfeiter.
fake
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳