order

package
v0.0.0-...-da924b9 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

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

Set of directions for data ordering.

Variables

This section is empty.

Functions

This section is empty.

Types

type By

type By struct {
	Field     string
	Direction string
}

By represents a field used to order by and direction.

func NewBy

func NewBy(field string, direction string) By

NewBy constructs a new By value with no checks.

func Parse

func Parse(fieldMappings map[string]string, orderBy string, defaultOrder By) (By, error)

Parse constructs a By value by parsing a string in the form of "field,direction" ie "user_id,ASC".

Jump to

Keyboard shortcuts

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