sort

package
v0.0.25 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByCollectionPath added in v0.0.22

func ByCollectionPath[T CollectionPathGetter](n1, n2 T) bool

func ByEmail added in v0.0.10

func ByEmail[T EmailGetter](n1, n2 T) bool

func ByName added in v0.0.10

func ByName[T NameGetter](n1, n2 T) bool

func ByRoleName added in v0.0.10

func ByRoleName[T RoleNameGetter](n1, n2 T) bool

func ByTagName added in v0.0.14

func ByTagName[T TagNameGetter](n1, n2 T) bool

func ByWorkspace added in v0.0.10

func ByWorkspace[T WorkspaceGetter](n1, n2 T) bool

Types

type CollectionPathGetter added in v0.0.22

type CollectionPathGetter interface {
	GetCollectionPath() string
}

type EmailGetter added in v0.0.10

type EmailGetter interface {
	GetEmail() string
}

type Multi

type Multi[T any] struct {
	LessFuncs []func(p1, p2 *T) bool
	// contains filtered or unexported fields
}

Multi is used to sort a slice of T using the list of LessFuncs, so you can order a table by different columns

func (*Multi[T]) Len

func (ms *Multi[T]) Len() int

func (*Multi[T]) Less

func (ms *Multi[T]) Less(i, j int) bool

func (*Multi[T]) Sort

func (ms *Multi[T]) Sort(changes []T)

func (*Multi[T]) Swap

func (ms *Multi[T]) Swap(i, j int)

type NameGetter added in v0.0.10

type NameGetter interface {
	GetName() string
}

type RoleNameGetter added in v0.0.10

type RoleNameGetter interface {
	GetRoleName() string
}

type TagNameGetter added in v0.0.14

type TagNameGetter interface {
	GetTagName() string
}

type WorkspaceGetter added in v0.0.10

type WorkspaceGetter interface {
	GetWorkspace() string
}

Jump to

Keyboard shortcuts

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