Documentation
¶
Index ¶
- Constants
- Variables
- func CanonicalHash(in []byte) (string, error)
- func MergeMaps[Map ~map[K]V, K comparable, V any](m1, m2 Map, skips ...K) Map
- func PathSegmentProblem(v string) string
- func RemoveManagedFields(d metav1.Object)
- func RemoveSpecificFields(d *unstructured.Unstructured, fields [][]string) error
- func SetLockObserver(f func(mode, outcome string))
- func ValidateCompletionAnnotation(annotations map[string]string) *field.Error
- func ValidateProfileScopeAnnotations(annotations map[string]string) field.ErrorList
- func ValidateStatusAnnotation(annotations map[string]string) *field.Error
- type MapMutex
Constants ¶
const ( LockModeWrite = "lock" LockModeRead = "rlock" LockOutcomeAcquired = "acquired" LockOutcomeTimeout = "timeout" )
Lock observer labels: the mode of a MapMutex acquisition and its outcome.
Variables ¶
var ContextNilError = errors.New("context is nil")
Functions ¶
func CanonicalHash ¶ added in v0.0.135
func MergeMaps ¶ added in v0.0.199
func MergeMaps[Map ~map[K]V, K comparable, V any](m1, m2 Map, skips ...K) Map
MergeMaps merges m2 key/values into m1 without overriding existing keys
func PathSegmentProblem ¶ added in v0.0.376
PathSegmentProblem says why v cannot be one segment of a storage key, or nothing.
func RemoveManagedFields ¶ added in v0.0.135
func RemoveSpecificFields ¶ added in v0.0.135
func RemoveSpecificFields(d *unstructured.Unstructured, fields [][]string) error
func SetLockObserver ¶ added in v0.0.341
func SetLockObserver(f func(mode, outcome string))
SetLockObserver installs f as the process-wide lock observer; nil uninstalls it. The observer is called after the MapMutex's internal mutex is released, never under it, and may be called from any goroutine.
func ValidateCompletionAnnotation ¶ added in v0.0.75
func ValidateProfileScopeAnnotations ¶ added in v0.0.376
ValidateProfileScopeAnnotations rejects a scope annotation whose value cannot be one segment of a key: "." or "..", or carrying a slash, a percent sign, a backslash or a NUL byte. An absent or empty value is left to the key builder, which has a shape for a Kubernetes profile without a cluster.
Types ¶
type MapMutex ¶ added in v0.0.67
type MapMutex[T comparable] struct { // contains filtered or unexported fields }
func NewMapMutex ¶
func NewMapMutex[T comparable]() MapMutex[T]