structutils

package
v1.1.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

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 StrategicMergePatch

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