sorting

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SortArrow

func SortArrow(order SortOrder) string

SortArrow returns the visual indicator for sort direction

func SortIntField

func SortIntField[T any](items []T, ascending bool, getField func(T) int)

SortIntField sorts a slice of items by an int field

func SortStringField

func SortStringField[T any](items []T, ascending bool, getField func(T) string)

SortStringField sorts a slice of items by a string field

Types

type SortConfig

type SortConfig struct {
	Field SortOrder
}

SortConfig holds the current sort configuration

type SortOrder

type SortOrder int

SortOrder represents the sort direction

const (
	Ascending SortOrder = iota
	Descending
)

Jump to

Keyboard shortcuts

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