sorting

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

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.

Jump to

Keyboard shortcuts

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