parameter

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

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__"

	Separator = "__goadmin_separator__"
)

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
	Animation    bool
	URLPath      string
	Fields       map[string][]string
	OrConditions map[string]string
	// contains filtered or unexported fields
}

func BaseParam

func BaseParam() Parameters

func GetParam

func GetParam(u *url.URL, defaultPageSize int, p ...string) Parameters

func GetParamFromURL

func GetParamFromURL(urlStr string, defaultPageSize int, defaultSortType, primaryKey string) Parameters

func (Parameters) AddField

func (param Parameters) AddField(field, value string) Parameters

func (Parameters) DeleteDetailPk

func (param Parameters) DeleteDetailPk() Parameters

func (Parameters) DeleteEditPk

func (param Parameters) DeleteEditPk() Parameters

func (Parameters) DeleteField

func (param Parameters) DeleteField(fields ...string) Parameters

func (Parameters) DeleteIsAll

func (param Parameters) DeleteIsAll() Parameters

func (Parameters) DeletePK

func (param Parameters) DeletePK() Parameters

func (Parameters) GetFieldOperator

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

func (Parameters) GetFieldValue

func (param Parameters) GetFieldValue(field string) string

func (Parameters) GetFieldValues

func (param Parameters) GetFieldValues(field string) []string

func (Parameters) GetFieldValuesStr

func (param Parameters) GetFieldValuesStr(field string) string

func (Parameters) GetFilterFieldValueEnd

func (param Parameters) GetFilterFieldValueEnd(field string) string

func (Parameters) GetFilterFieldValueStart

func (param Parameters) GetFilterFieldValueStart(field string) string

func (Parameters) GetFixedParamStr

func (param Parameters) GetFixedParamStr() url.Values

func (Parameters) GetFixedParamStrFromCache

func (param Parameters) GetFixedParamStrFromCache() url.Values

func (Parameters) GetFixedParamStrWithoutColumnsAndPage

func (param Parameters) GetFixedParamStrWithoutColumnsAndPage() string

func (Parameters) GetFixedParamStrWithoutSort

func (param Parameters) GetFixedParamStrWithoutSort() string

func (Parameters) GetLastPageRouteParamStr

func (param Parameters) GetLastPageRouteParamStr(cache ...bool) string

func (Parameters) GetNextPageRouteParamStr

func (param Parameters) GetNextPageRouteParamStr(cache ...bool) string

func (Parameters) GetRouteParamStr

func (param Parameters) GetRouteParamStr() string

func (Parameters) GetRouteParamStrWithoutPageSize

func (param Parameters) GetRouteParamStrWithoutPageSize(page string) string

func (Parameters) IsAll

func (param Parameters) IsAll() bool

func (Parameters) Join

func (param Parameters) Join() string

func (Parameters) PK

func (param Parameters) PK() string

func (Parameters) PKs

func (param Parameters) PKs() []string

func (Parameters) SetPage

func (param Parameters) SetPage(page string) Parameters

func (Parameters) SetPageSize

func (param Parameters) SetPageSize(pageSize string) Parameters

func (Parameters) Statement

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

func (Parameters) URL

func (param Parameters) URL(page string) string

func (Parameters) URLNoAnimation

func (param Parameters) URLNoAnimation(page string) string

func (Parameters) WithIsAll

func (param Parameters) WithIsAll(isAll bool) Parameters

func (Parameters) WithPKs

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

func (Parameters) WithURLPath

func (param Parameters) WithURLPath(path string) Parameters

Jump to

Keyboard shortcuts

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