structutils

package
v1.3.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: Apache-2.0 Imports: 8 Imported by: 0 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 DereferenceList

func DereferenceList[T any](items []*T) []T

Convert a referenced list to a list.

func GetBoolFromAnnotations

func GetBoolFromAnnotations(annotations map[string]string, key string) (bool, error)

GetBoolFromAnnotations returns the value of annotation. Returns false if not set or the value is invalid.

func GetNumberFromAnnotations

func GetNumberFromAnnotations(annotations map[string]string, key string) (int32, error)

GetNumberFromAnnotations returns the integer value of annotation. Returns 0 if not set or the value is invalid.

func GetTimeFromAnnotations

func GetTimeFromAnnotations(annotations map[string]string, key string) (time.Time, error)

GetTimeFromAnnotations returns the integer value of annotation. Returns unit Time if not set or the value is invalid.

func Keys

func Keys[K comparable, V any](items map[K]V) []K

Get keys from map

func MergeList

func MergeList[T any](items ...[]T) []T

MergeList concatenates all lists.

func MergeMaps

func MergeMaps(mapList ...map[string]string) map[string]string

func ReferenceList

func ReferenceList[T any](items []T) []*T

Convert a list to a referenced list.

func SortedDedup added in v1.3.0

func SortedDedup(in []string) []string

SortedDedup trims whitespace from each entry, drops empty entries and duplicates, and returns the result sorted, normalizing a string set into a deterministic, comparable list.

func StrategicMergePatch added in v1.1.0

func StrategicMergePatch[T any](base, patch *T) *T

StrategicMergePatch merges two objects via kubernetes StrategicMergePatch after empty fields are pruned.

Empty fields are considered not given and are pruned on the patch object. Doing so avoids empty values from overwriting the base object.

func Values

func Values[K comparable, V any](items map[K]V) []V

Get values from map

Types

This section is empty.

Jump to

Keyboard shortcuts

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