order

package
v0.0.0-...-c4114b5 Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package order provides support for describing the ordering of data.

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