sortable

package
v0.0.0-...-2caf503 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	String = "string"
	Semver = "semver"
	Date   = "date"
)

The kinds of data that can be in a string field.

View Source
const (
	ASC  = "asc"
	DESC = "desc"
)

The sorting direction possibilities.

Variables

This section is empty.

Functions

func CompareDates

func CompareDates(a string, b string, direction string) bool

CompareDates represents the comparison algorithm for string-encoded dates.

func CompareSemvers

func CompareSemvers(a string, b string, direction string) bool

CompareSemvers represents the comparison algorithm for string-encoded versions, in semver format.

func CompareStrings

func CompareStrings(a string, b string, direction string) bool

CompareStrings represents the comparison algorithm for regular strings.

func GetCompareFunc

func GetCompareFunc(t string) func(string, string, string) bool

GetCompareFunc gets the right comparison algorithm for the provided type.

Types

type Sortable

type Sortable struct {
	SortType string
}

Sortable makes the data type that embeds it, sortable.

Jump to

Keyboard shortcuts

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