repositories

package
v0.0.0-...-d23ef4a Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2018 License: MIT Imports: 3 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrOrderNotSupport     = errors.New("order not support")
	ErrPagingSize          = errors.New("paging size is too large")
	ErrNoFieldCanBeOrdered = errors.New("no field can be ordered")
	ErrFieldCannotOrder    = errors.New("field can't be ordered")
	ErrFieldCannotASC      = errors.New("field can't be ordered")
	ErrFieldCannotDESC     = errors.New("field can't be ordered")
)

Functions

This section is empty.

Types

type Order

type Order uint8
const (
	ASC Order = 1 << iota
	DESC
)

func ParseOrder

func ParseOrder(order string) (Order, error)

func (Order) String

func (o Order) String() string

type OrderPaging

type OrderPaging struct {
	CanOrderFields map[string]Order
	MaxSize        uint32
}

func (OrderPaging) BuildPagingOrder

func (o OrderPaging) BuildPagingOrder(page uint32, size uint32, sorts []Sort) (string, error)

type Sort

type Sort struct {
	Name  string
	Order Order
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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