tools

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2024 License: Apache-2.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

View Source
const CredentialsSecretKey = "credentials"

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 LoadConfigInto

func LoadConfigInto(conf any, fromDir string) error

func NamespacedUUID added in v0.13.0

func NamespacedUUID(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 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 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

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