Documentation ¶
Index ¶
- Constants
- func AppendTypeMeta(kind string, version schema.GroupVersion, crs ...ObjectWithTypeMeta)
- func CleanObjectMeta(crs ...metav1.Object)
- func DeserializeCRD(cr runtime.Object, content []byte) error
- func GetMapValue[T any, K comparable](m map[K]T, k K, def T) T
- func MapMap[T any, U any](m map[string]T, fn func(T) U) map[string]U
- func MapPtr[T any, U any](v *T, fn func(T) U) *U
- func MapSlice[T any, U any](s []T, fn func(T) U) []U
- func MergeMaps(ms ...map[string]string) map[string]string
- func Ptr[T any](v T) *T
- func PtrOrNil[T comparable](v T) *T
- func ResolvePtr[T any](v *T, def T) T
- func SerializeCRD(cr interface{}, opts SerializeOptions) ([]byte, error)
- func SerializeCRDs[T interface{}](crs []T, opts SerializeOptions) ([]byte, error)
- type ObjectWithTypeMeta
- type SerializeOptions
Constants ¶
View Source
const ( ModeStandalone = "standalone" ModeAgent = "agent" )
Variables ¶
This section is empty.
Functions ¶
func AppendTypeMeta ¶
func AppendTypeMeta(kind string, version schema.GroupVersion, crs ...ObjectWithTypeMeta)
func CleanObjectMeta ¶
func GetMapValue ¶
func GetMapValue[T any, K comparable](m map[K]T, k K, def T) T
func MergeMaps ¶
MergeMaps merges multiple maps into one, the later ones takes precedence over the first ones
func PtrOrNil ¶
func PtrOrNil[T comparable](v T) *T
func ResolvePtr ¶
func ResolvePtr[T any](v *T, def T) T
func SerializeCRD ¶
func SerializeCRD(cr interface{}, opts SerializeOptions) ([]byte, error)
func SerializeCRDs ¶
func SerializeCRDs[T interface{}](crs []T, opts SerializeOptions) ([]byte, error)
SerializeCRDs builds a serialized version of CRD, persisting the order of properties from the struct.
Types ¶
type ObjectWithTypeMeta ¶
type ObjectWithTypeMeta interface {
SetGroupVersionKind(schema.GroupVersionKind)
}
type SerializeOptions ¶
type SerializeOptions struct { OmitCreationTimestamp bool CleanMeta bool Kind string GroupVersion *schema.GroupVersion }
Click to show internal directories.
Click to hide internal directories.