Documentation
¶
Overview ¶
Package sorting provides generic sorting utilities for registry resources.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ByName ¶
func ByName[T any, PT interface { *T NameGetter }](items []T)
ByName sorts a slice of objects by their Name in alphabetical order. Use this for cluster-scoped resources.
func ByNamespacedName ¶
func ByNamespacedName[T any, PT interface { *T NamespaceGetter }](items []T)
ByNamespacedName sorts a slice of objects by Namespace/Name in alphabetical order. Use this for namespace-scoped resources.
Types ¶
type NameGetter ¶
type NameGetter interface {
GetName() string
}
NameGetter is an interface for objects that have a Name.
type NamespaceGetter ¶
type NamespaceGetter interface {
NameGetter
GetNamespace() string
}
NamespaceGetter is an interface for objects that have both Name and Namespace.
Click to show internal directories.
Click to hide internal directories.