sorts

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 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

This section is empty.

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, disallowFK bool) (*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) SetSubfield added in v0.1.5

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

SetSubfield sets the subfield for given sortfield

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