util

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: Apache-2.0 Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Difference added in v0.2.0

func Difference(a, b []string) (diff []string)

Difference returns items that exist in b but not in a

func IsLogLevelVerbose added in v1.0.0

func IsLogLevelVerbose() bool

func IsLogStructured added in v1.0.0

func IsLogStructured() bool

func MergeEnvLists added in v0.12.0

func MergeEnvLists(envLists ...[]corev1.EnvVar) []corev1.EnvVar

func SSMapEqual

func SSMapEqual(a, b map[string]string) bool

SSMapEqual compares maps for equality

func SSMapFilterByKeys added in v0.4.0

func SSMapFilterByKeys(m map[string]string, keys []string) map[string]string

SSMapFilterByKeys returns a new map that contains keys from the keys array existing in the m map.

func SSMapMerge

func SSMapMerge(ms ...map[string]string) map[string]string

SSMapMerge merges maps ms from left to right with overwriting existing keys

func SandboxedTemplateSet added in v1.2.0

func SandboxedTemplateSet() (*pongo2.TemplateSet, error)

SandboxedTemplateSet returns a pongo2 TemplateSet with file-access tags banned to prevent server-side template injection from user-controlled .spec.*.configuration fields.

func WrapWithDeepestStack added in v1.2.0

func WrapWithDeepestStack(err error, msg string) error

WrapWithDeepestStack preserves the full error message chain, but limits verbose logging to the deepest pkg/errors stack. This avoids the default github.com/pkg/errors behavior where %+v prints stack traces from all wraps.

Types

type EnvConfig added in v1.3.0

type EnvConfig struct {
	WatchNamespace    string        `envconfig:"WATCH_NAMESPACE" required:"true"`
	OperatorNamespace *string       `envconfig:"OPERATOR_NAMESPACE"`
	LeaderElection    *bool         `envconfig:"PSO_LEADER_ELECTION_ENABLED"`
	LeaderElectionID  string        `envconfig:"PSO_LEADER_ELECTION_LEASE_NAME"`
	LeaseDuration     time.Duration `envconfig:"PSO_LEADER_ELECTION_LEASE_DURATION" default:"60s"`
	RenewDeadline     time.Duration `envconfig:"PSO_LEADER_ELECTION_RENEW_DEADLINE" default:"40s"`
	RetryPeriod       time.Duration `envconfig:"PSO_LEADER_ELECTION_RETRY_PERIOD" default:"10s"`
	Workers           *int          `envconfig:"MAX_CONCURRENT_RECONCILES"`
}

func GetEnvConfig added in v1.3.0

func GetEnvConfig() (EnvConfig, error)

type SensitiveWriter added in v0.6.0

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

func NewSensitiveWriter added in v0.6.0

func NewSensitiveWriter(w io.Writer, r *regexp.Regexp) *SensitiveWriter

func (*SensitiveWriter) Write added in v0.6.0

func (s *SensitiveWriter) Write(p []byte) (n int, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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