fltr

package
v0.0.0-...-c937b9e Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2015 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultSortName       = "sort"
	DefaultSortSeparator  = ","
	DefaultSortFieldLimit = 3
)

Variables

View Source
var (
	FilterTag       = "fltr"
	ModifierDivider = "_"
)

Functions

func FromRequest

func FromRequest(req *restful.Request, raw interface{}) (bson.M, error)

func GetParams

func GetParams(ws *restful.WebService, raw interface{}) []*restful.Parameter

func GetQuery

func GetQuery(raw interface{}) bson.M

Types

type Converter

type Converter interface {
	Convert(string) (interface{}, error)
}

type EnumConverter

type EnumConverter interface {
	Enumer
	Converter
}

type Enumer

type Enumer interface {
	Enum() []interface{}
}

type Sorter

type Sorter struct {
	SortName       string
	SortSeparator  string
	SortFieldLimit int
	Fields         []string
}

func NewSorter

func NewSorter(fields ...string) *Sorter

func (*Sorter) Param

func (s *Sorter) Param() *restful.Parameter

func (*Sorter) Parse

func (s *Sorter) Parse(req *restful.Request) []string

Jump to

Keyboard shortcuts

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