formfilter

package
v2.42.35+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: Apache-2.0 Imports: 6 Imported by: 29

Documentation

Index

Constants

View Source
const All = `*`

Variables

This section is empty.

Functions

func Build

func Build(options ...Options) echo.FormDataFilter

func BuildWithKeyNormalizer

func BuildWithKeyNormalizer(keyNormalizer func(string) string, options ...Options) echo.FormDataFilter

Types

type Data

type Data struct {
	Key   string
	Value []string
	// contains filtered or unexported fields
}

func (*Data) NormalizedKey

func (d *Data) NormalizedKey() string

type Filter

type Filter func(*Data)

type Filters

type Filters map[string][]Filter

type Options

type Options func() (key string, filter Filter)

func DateToTimestamp

func DateToTimestamp(field string, layouts ...string) Options

DateToTimestamp 日期转时间戳

func EndDateToTimestamp

func EndDateToTimestamp(field string, layouts ...string) Options

EndDateToTimestamp 结束日期(当天的最后一秒)转时间戳

func Exclude

func Exclude(fieldNames ...string) Options

Exclude 排除字段

func Format

func Format(field string, formatter func([]string) []string) Options

Format 格式化字段值

func Include

func Include(fieldNames ...string) Options

Include 包含字段

func JoinValues

func JoinValues(field string) Options

func SplitValues

func SplitValues(field string, seperators ...string) Options

func StartDateToTimestamp

func StartDateToTimestamp(field string, layouts ...string) Options

StartDateToTimestamp 起始日期(当天的零点)转时间戳

func TimestampToDate

func TimestampToDate(field string, layouts ...string) Options

TimestampToDate 时间戳转日期

type OptionsList

type OptionsList []Options

func New

func New() *OptionsList

func (*OptionsList) Add

func (a *OptionsList) Add(options ...Options) *OptionsList

func (*OptionsList) AppendTo

func (a *OptionsList) AppendTo(other *OptionsList) *OptionsList

func (*OptionsList) Build

func (a *OptionsList) Build() echo.FormDataFilter

func (*OptionsList) Reset

func (a *OptionsList) Reset(options ...Options) *OptionsList

func (*OptionsList) Size

func (a *OptionsList) Size() int

func (*OptionsList) Slice

func (a *OptionsList) Slice() OptionsList

Jump to

Keyboard shortcuts

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