sorts

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 26, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MaxNestedRelLevel int = 1
)

Functions

func SetSubfield

func SetSubfield(s *SortField, sortSplitted []string, order Order) (invalidField bool)

SetSubfield sets the subfield for given sortfield

Types

type Order

type Order int

Order is an enumerator that describes the order of sorting

const (
	AscendingOrder Order = iota
	DescendingOrder
)

func (Order) String

func (o Order) String() string

String implements Stringer interface

type SortError

type SortError struct {
	FieldName string
	Err       string
}

func (*SortError) Error

func (s *SortError) Error() string

type SortField

type SortField struct {
	// contains filtered or unexported fields
}

SortField is a field that describes the sorting rules for given

func Copy

func Copy(s *SortField) *SortField

Copy copies provided SortField

func NewRawSortField

func NewRawSortField(m *models.ModelStruct, sort string) (*SortField, error)

NewRawSortField returns raw sortfield

func NewSortField

func NewSortField(sField *models.StructField, o Order, subs ...*SortField) *SortField

NewSortField creates new sortField

func (*SortField) Order

func (s *SortField) Order() Order

Order returns sortFields order

func (*SortField) StructField

func (s *SortField) StructField() *models.StructField

StructField returns sortField's structure

Jump to

Keyboard shortcuts

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