sortx

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2023 License: BSD-3-Clause Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Key

type Key string

func (Key) String added in v0.9.0

func (k Key) String() string

type Order

type Order string
const (
	OrderAscending  Order = "ASC"
	OrderDescending Order = "DESC"
)

func (Order) String added in v0.9.0

func (o Order) String() string

type Sort

type Sort struct {
	Key      Key
	Order    Order
	Original string
}

type Sorts added in v0.9.0

type Sorts []Sort

func NewSorts

func NewSorts(qs string) Sorts

NewSorts create sorting based on Format:

sort=key1:asc,key2:desc,key3:asc

func (Sorts) Desc added in v0.10.0

func (s Sorts) Desc() bool

func (Sorts) Map added in v0.9.0

func (s Sorts) Map() map[string]string

func (Sorts) OrderBy added in v0.9.0

func (s Sorts) OrderBy(reverse ...bool) string

Jump to

Keyboard shortcuts

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