parameter

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2020 License: Apache-2.0 Imports: 5 Imported by: 77

Documentation

Index

Constants

View Source
const (
	Page     = "__page"
	PageSize = "__pageSize"
	Sort     = "__sort"
	SortType = "__sort_type"
	Columns  = "__columns"
	Prefix   = "__prefix"
	Pjax     = "_pjax"

	IsAll      = "is_all"
	PrimaryKey = "pk"

	True  = "true"
	False = "false"

	FilterRangeParamStartSuffix = "_start__goadmin"
	FilterRangeParamEndSuffix   = "_end__goadmin"
	FilterParamJoinInfix        = "_goadmin_join_"
	FilterParamOperatorSuffix   = "__goadmin_operator__"
	FilterParamCountInfix       = "__goadmin_index__"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Parameters

type Parameters struct {
	Page        string
	PageInt     int
	PageSize    string
	PageSizeInt int
	SortField   string
	Columns     []string
	SortType    string
	Fields      map[string]string
}

func BaseParam added in v1.2.0

func BaseParam() Parameters

func GetParam

func GetParam(values url.Values, defaultPageSize int, primaryKey, defaultSortType string) Parameters

func GetParamFromUrl

func GetParamFromUrl(value string, fromList bool, defaultPageSize int, primaryKey, defaultSortType string) Parameters

func (Parameters) GetFieldOperator added in v1.1.2

func (param Parameters) GetFieldOperator(field, suffix string) string

func (Parameters) GetFieldValue added in v1.1.2

func (param Parameters) GetFieldValue(field string) string

func (Parameters) GetFilterFieldValueEnd added in v1.2.3

func (param Parameters) GetFilterFieldValueEnd(field string) string

func (Parameters) GetFilterFieldValueStart added in v1.2.3

func (param Parameters) GetFilterFieldValueStart(field string) string

func (Parameters) GetFixedParamStr

func (param Parameters) GetFixedParamStr() url.Values

func (Parameters) GetLastPageRouteParamStr

func (param Parameters) GetLastPageRouteParamStr() string

func (Parameters) GetNextPageRouteParamStr

func (param Parameters) GetNextPageRouteParamStr() string

func (Parameters) GetRouteParamStr

func (param Parameters) GetRouteParamStr() string

func (Parameters) GetRouteParamStrWithoutPageSize

func (param Parameters) GetRouteParamStrWithoutPageSize() string

func (Parameters) IsAll added in v1.2.0

func (param Parameters) IsAll() bool

func (Parameters) Join added in v1.1.8

func (param Parameters) Join() string

func (Parameters) PK added in v1.2.0

func (param Parameters) PK() []string

func (Parameters) SetPage

func (param Parameters) SetPage(page string) Parameters

func (Parameters) Statement added in v1.2.3

func (param Parameters) Statement(wheres, delimiter string, whereArgs []interface{}, columns, existKeys []string,
	filterProcess func(string, string, string) string, getJoinTable func(string) string) (string, []interface{}, []string)

func (Parameters) WithIsAll added in v1.2.0

func (param Parameters) WithIsAll(isAll bool) Parameters

func (Parameters) WithPK added in v1.2.0

func (param Parameters) WithPK(id ...string) Parameters

Jump to

Keyboard shortcuts

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