sort

package
v1.116.1-rc.1 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByPodCreationTimestamp

func ByPodCreationTimestamp(pod corev1.Pod, compareWith corev1.Pod) bool

ByPodCreationTimestamp compares CreationTimestamp of pod and compareWith. Returns true if CreationTimestamp for pod is less than compareWith.

func Pods

func Pods(pods []corev1.Pod, lessFunc PodLessFunc, direction Direction)

Pods sorts the slice of pods with the provided lessFunc.

Types

type Direction

type Direction int
const (
	Ascending Direction = iota
	Descending
)

type PodLessFunc

type PodLessFunc func(pod corev1.Pod, compareWith corev1.Pod) bool

PodLessFunc compares pod and compareWith, and must return true if pod is less than compareWith.

Jump to

Keyboard shortcuts

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