params

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Defaults represents the default params if
	// none were passed for templates.
	Defaults = params.Defaults{
		Page:           params.DefaultPage,
		Limit:          params.DefaultLimit,
		OrderBy:        "updated_at",
		OrderDirection: "desc",
	}
)

Functions

This section is empty.

Types

type Query

type Query map[string]interface{}

Query defines the map of arguments passed to list functions in templates.

func (Query) Default

func (q Query) Default(param, def string) interface{}

Default

Sets or gets default parameters for the Query. If the parameter is not found, it will return the default string passed.

func (Query) Get

func (q Query) Get(orderBy, orderDirection string) params.Params

Get

Returns parameters for the store to used for obtaining multiple entities. If the orderBy or orderDirection arguments are not passed, defaults will be used.

func (Query) Param

func (q Query) Param(param string) string

Param

Is an implementation of a stringer to return parameters from the Query map.

Jump to

Keyboard shortcuts

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