param

package
v2.1.4+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2020 License: Apache-2.0 Imports: 9 Imported by: 277

Documentation

Index

Constants

View Source
const (
	EmptyHTML      = template.HTML(``)
	EmptyJS        = template.JS(``)
	EmptyCSS       = template.CSS(``)
	EmptyHTMLAttr  = template.HTMLAttr(``)
	DateTimeNormal = `2006-01-02 15:04:05`
	DateTimeShort  = `2006-01-02 15:04`
	DateNormal     = `2006-01-02`
	TimeNormal     = `15:04:05`
	DateMd         = `01-02`
	DateShort      = `06-01-02`
	TimeShort      = `15:04`
)

Variables

View Source
var EmptyTime = time.Time{}

Functions

func AsBool added in v1.4.3

func AsBool(val interface{}) bool

func AsBytes added in v1.5.0

func AsBytes(val interface{}) []byte

func AsCSS added in v1.4.3

func AsCSS(val interface{}) template.CSS

func AsDateTime added in v1.4.3

func AsDateTime(val interface{}, layouts ...string) time.Time

func AsFloat32 added in v1.4.3

func AsFloat32(val interface{}) float32

func AsFloat64 added in v1.4.3

func AsFloat64(val interface{}) float64

func AsHTML added in v1.4.3

func AsHTML(val interface{}) template.HTML

func AsHTMLAttr added in v1.4.3

func AsHTMLAttr(val interface{}) template.HTMLAttr

func AsInt added in v1.4.3

func AsInt(val interface{}) int

func AsInt16 added in v1.4.3

func AsInt16(val interface{}) int16

func AsInt32 added in v1.4.3

func AsInt32(val interface{}) int32

func AsInt64 added in v1.4.3

func AsInt64(val interface{}) int64

func AsInt8 added in v1.4.3

func AsInt8(val interface{}) int8

func AsJS added in v1.4.3

func AsJS(val interface{}) template.JS

func AsString added in v1.4.3

func AsString(val interface{}) string

func AsTimestamp added in v1.4.3

func AsTimestamp(val interface{}) time.Time

func AsType added in v1.5.0

func AsType(typ string, val interface{}) interface{}

func AsUint added in v1.4.3

func AsUint(val interface{}) uint

func AsUint16 added in v1.4.3

func AsUint16(val interface{}) uint16

func AsUint32 added in v1.4.3

func AsUint32(val interface{}) uint32

func AsUint64 added in v1.4.3

func AsUint64(val interface{}) uint64

func AsUint8 added in v1.4.3

func AsUint8(val interface{}) uint8

func Decr added in v1.4.3

func Decr(val interface{}, n int64) int64

func GetByIndex added in v1.6.0

func GetByIndex(v interface{}, i int, defaults ...interface{}) interface{}

func Incr added in v1.4.3

func Incr(val interface{}, n int64) int64

Types

type SafeMap added in v1.5.0

type SafeMap struct {
	sync.Map
}

func NewMap added in v1.5.0

func NewMap() *SafeMap

func (*SafeMap) Bool added in v1.5.0

func (s *SafeMap) Bool(key interface{}, defaults ...interface{}) bool

func (*SafeMap) CSS added in v1.5.0

func (s *SafeMap) CSS(key interface{}, defaults ...interface{}) template.CSS

func (*SafeMap) DateTime added in v1.5.0

func (s *SafeMap) DateTime(key interface{}, layouts ...string) time.Time

func (*SafeMap) Decr added in v1.5.0

func (s *SafeMap) Decr(key interface{}, n int64, defaults ...interface{}) int64

func (*SafeMap) Float32 added in v1.5.0

func (s *SafeMap) Float32(key interface{}, defaults ...interface{}) float32

func (*SafeMap) Float64 added in v1.5.0

func (s *SafeMap) Float64(key interface{}, defaults ...interface{}) float64

func (*SafeMap) Get added in v1.5.0

func (s *SafeMap) Get(key interface{}, defaults ...interface{}) interface{}

func (*SafeMap) GetOk added in v1.5.0

func (s *SafeMap) GetOk(key interface{}) (interface{}, bool)

func (*SafeMap) GetOrSet added in v1.5.0

func (s *SafeMap) GetOrSet(key, value interface{}) (actual interface{}, loaded bool)

func (*SafeMap) HTML added in v1.5.0

func (s *SafeMap) HTML(key interface{}, defaults ...interface{}) template.HTML

func (*SafeMap) HTMLAttr added in v1.5.0

func (s *SafeMap) HTMLAttr(key interface{}, defaults ...interface{}) template.HTMLAttr

func (*SafeMap) Has added in v1.5.0

func (s *SafeMap) Has(key interface{}) bool

func (*SafeMap) Incr added in v1.5.0

func (s *SafeMap) Incr(key interface{}, n int64, defaults ...interface{}) int64

func (*SafeMap) Int added in v1.5.0

func (s *SafeMap) Int(key interface{}, defaults ...interface{}) int

func (*SafeMap) Int16 added in v1.5.0

func (s *SafeMap) Int16(key interface{}, defaults ...interface{}) int16

func (*SafeMap) Int32 added in v1.5.0

func (s *SafeMap) Int32(key interface{}, defaults ...interface{}) int32

func (*SafeMap) Int64 added in v1.5.0

func (s *SafeMap) Int64(key interface{}, defaults ...interface{}) int64

func (*SafeMap) Int8 added in v1.5.0

func (s *SafeMap) Int8(key interface{}, defaults ...interface{}) int8

func (*SafeMap) JS added in v1.5.0

func (s *SafeMap) JS(key interface{}, defaults ...interface{}) template.JS

func (*SafeMap) Set added in v1.5.0

func (s *SafeMap) Set(key, value interface{})

func (*SafeMap) Split added in v1.5.0

func (s *SafeMap) Split(key interface{}, sep string, limit ...int) StringSlice

func (*SafeMap) String added in v1.5.0

func (s *SafeMap) String(key interface{}, defaults ...interface{}) string

func (*SafeMap) Timestamp added in v1.5.0

func (s *SafeMap) Timestamp(key interface{}, defaults ...interface{}) time.Time

func (*SafeMap) Trim added in v1.5.0

func (s *SafeMap) Trim(key interface{}, defaults ...interface{}) String

func (*SafeMap) Uint added in v1.5.0

func (s *SafeMap) Uint(key interface{}, defaults ...interface{}) uint

func (*SafeMap) Uint16 added in v1.5.0

func (s *SafeMap) Uint16(key interface{}, defaults ...interface{}) uint16

func (*SafeMap) Uint32 added in v1.5.0

func (s *SafeMap) Uint32(key interface{}, defaults ...interface{}) uint32

func (*SafeMap) Uint64 added in v1.5.0

func (s *SafeMap) Uint64(key interface{}, defaults ...interface{}) uint64

func (*SafeMap) Uint8 added in v1.5.0

func (s *SafeMap) Uint8(key interface{}, defaults ...interface{}) uint8

type Store added in v1.5.0

type Store map[string]interface{}

func AsStore added in v1.5.0

func AsStore(val interface{}) Store

func (Store) Bool added in v1.5.0

func (s Store) Bool(key string, defaults ...interface{}) bool

func (Store) CSS added in v1.5.0

func (s Store) CSS(key string, defaults ...interface{}) template.CSS

func (Store) Children added in v1.5.0

func (s Store) Children(keys ...interface{}) Store

func (Store) Clone added in v1.5.0

func (s Store) Clone() Store

func (Store) DateTime added in v1.5.0

func (s Store) DateTime(key string, layouts ...string) time.Time

func (Store) Decr added in v1.5.0

func (s Store) Decr(key string, n int64, defaults ...interface{}) int64

func (Store) DeepMerge added in v1.5.0

func (s Store) DeepMerge(source Store)

func (Store) Delete added in v1.5.0

func (s Store) Delete(keys ...string)

func (Store) Float32 added in v1.5.0

func (s Store) Float32(key string, defaults ...interface{}) float32

func (Store) Float64 added in v1.5.0

func (s Store) Float64(key string, defaults ...interface{}) float64

func (Store) Get added in v1.5.0

func (s Store) Get(key string, defaults ...interface{}) interface{}

func (Store) HTML added in v1.5.0

func (s Store) HTML(key string, defaults ...interface{}) template.HTML

func (Store) HTMLAttr added in v1.5.0

func (s Store) HTMLAttr(key string, defaults ...interface{}) template.HTMLAttr

func (Store) Has added in v1.5.0

func (s Store) Has(key string) bool

func (Store) Incr added in v1.5.0

func (s Store) Incr(key string, n int64, defaults ...interface{}) int64

func (Store) Int added in v1.5.0

func (s Store) Int(key string, defaults ...interface{}) int

func (Store) Int16 added in v1.5.0

func (s Store) Int16(key string, defaults ...interface{}) int16

func (Store) Int32 added in v1.5.0

func (s Store) Int32(key string, defaults ...interface{}) int32

func (Store) Int64 added in v1.5.0

func (s Store) Int64(key string, defaults ...interface{}) int64

func (Store) Int8 added in v1.5.0

func (s Store) Int8(key string, defaults ...interface{}) int8

func (Store) JS added in v1.5.0

func (s Store) JS(key string, defaults ...interface{}) template.JS

func (Store) MarshalXML added in v1.5.0

func (s Store) MarshalXML(e *xml.Encoder, start xml.StartElement) error

MarshalXML allows type Store to be used with xml.Marshal

func (Store) Set added in v1.5.0

func (s Store) Set(key string, value interface{}) Store

func (Store) Split added in v1.5.0

func (s Store) Split(key string, sep string, limit ...int) StringSlice

func (Store) Store added in v1.5.0

func (s Store) Store(key string, defaults ...interface{}) Store

func (Store) String added in v1.5.0

func (s Store) String(key string, defaults ...interface{}) string

func (Store) Timestamp added in v1.5.0

func (s Store) Timestamp(key string, defaults ...interface{}) time.Time

func (Store) Transform added in v1.6.0

func (s Store) Transform(transfers map[string]Transfer) Store

func (Store) Trim added in v1.5.0

func (s Store) Trim(key string, defaults ...interface{}) String

func (Store) Uint added in v1.5.0

func (s Store) Uint(key string, defaults ...interface{}) uint

func (Store) Uint16 added in v1.5.0

func (s Store) Uint16(key string, defaults ...interface{}) uint16

func (Store) Uint32 added in v1.5.0

func (s Store) Uint32(key string, defaults ...interface{}) uint32

func (Store) Uint64 added in v1.5.0

func (s Store) Uint64(key string, defaults ...interface{}) uint64

func (Store) Uint8 added in v1.5.0

func (s Store) Uint8(key string, defaults ...interface{}) uint8

type String

type String string

func Trim added in v1.4.3

func Trim(val interface{}) String

func (String) Bool

func (p String) Bool() bool

func (String) DateTime added in v1.4.0

func (p String) DateTime(layouts ...string) time.Time

func (String) Float32

func (p String) Float32() float32

func (String) Float64

func (p String) Float64() float64

func (String) Int

func (p String) Int() int

func (String) Int32

func (p String) Int32() int32

func (String) Int64

func (p String) Int64() int64

func (String) Interface added in v1.4.0

func (p String) Interface() interface{}

func (String) Raw added in v1.4.2

func (p String) Raw() string

func (String) Split added in v1.4.0

func (p String) Split(sep string, limit ...int) StringSlice

func (String) String

func (p String) String() string

func (String) Timestamp added in v1.4.0

func (p String) Timestamp() time.Time

func (String) Trim added in v1.4.0

func (p String) Trim() String

func (String) Uint

func (p String) Uint() uint

func (String) Uint32

func (p String) Uint32() uint32

func (String) Uint64

func (p String) Uint64() uint64

type StringMap added in v1.3.5

type StringMap map[string]String

func ToStringMap added in v1.4.0

func ToStringMap(m map[string]string) StringMap

func (StringMap) Bool added in v1.3.5

func (p StringMap) Bool(key string) bool

func (StringMap) DateTime added in v1.4.0

func (p StringMap) DateTime(key string) time.Time

func (StringMap) Float32 added in v1.3.5

func (p StringMap) Float32(key string) float32

func (StringMap) Float64 added in v1.3.5

func (p StringMap) Float64(key string) float64

func (StringMap) Int added in v1.3.5

func (p StringMap) Int(key string) int

func (StringMap) Int32 added in v1.3.5

func (p StringMap) Int32(key string) int32

func (StringMap) Int64 added in v1.3.5

func (p StringMap) Int64(key string) int64

func (StringMap) Interface added in v1.4.0

func (p StringMap) Interface(key string) interface{}

func (StringMap) Interfaces added in v1.4.0

func (p StringMap) Interfaces() map[string]interface{}

func (StringMap) Raw added in v1.4.2

func (p StringMap) Raw(key string) string

func (StringMap) Split added in v1.4.0

func (p StringMap) Split(key string, sep string, limit ...int) StringSlice

func (StringMap) String added in v1.3.5

func (p StringMap) String(key string) string

func (StringMap) Timestamp added in v1.4.0

func (p StringMap) Timestamp(key string) time.Time

func (StringMap) Uint added in v1.3.5

func (p StringMap) Uint(key string) uint

func (StringMap) Uint32 added in v1.3.5

func (p StringMap) Uint32(key string) uint32

func (StringMap) Uint64 added in v1.3.5

func (p StringMap) Uint64(key string) uint64

type StringSlice added in v1.3.0

type StringSlice []string

func Split added in v1.4.3

func Split(val interface{}, sep string, limit ...int) StringSlice

func (StringSlice) Bool added in v1.3.0

func (p StringSlice) Bool(filters ...func(int, bool) bool) []bool

func (StringSlice) Float32 added in v1.3.0

func (p StringSlice) Float32(filters ...func(int, float32) bool) []float32

func (StringSlice) Float64 added in v1.3.0

func (p StringSlice) Float64(filters ...func(int, float64) bool) []float64

func (StringSlice) GetByIndex added in v1.6.0

func (p StringSlice) GetByIndex(i int, defaults ...string) string

func (StringSlice) HasValue added in v1.5.0

func (p StringSlice) HasValue(v interface{}) bool

func (StringSlice) Int added in v1.3.0

func (p StringSlice) Int(filters ...func(int, int) bool) []int

func (StringSlice) Int32 added in v1.3.0

func (p StringSlice) Int32(filters ...func(int, int32) bool) []int32

func (StringSlice) Int64 added in v1.3.0

func (p StringSlice) Int64(filters ...func(int, int64) bool) []int64

func (StringSlice) Interface added in v1.4.0

func (p StringSlice) Interface(filters ...func(int, string) bool) []interface{}

func (StringSlice) Join added in v1.4.2

func (p StringSlice) Join(sep string) string

func (StringSlice) String added in v1.3.0

func (p StringSlice) String() []string

func (StringSlice) Uint added in v1.3.0

func (p StringSlice) Uint(filters ...func(int, uint) bool) []uint

func (StringSlice) Uint32 added in v1.3.0

func (p StringSlice) Uint32(filters ...func(int, uint32) bool) []uint32

func (StringSlice) Uint64 added in v1.3.0

func (p StringSlice) Uint64(filters ...func(int, uint64) bool) []uint64

type Transfer added in v1.6.0

type Transfer interface {
	Transform(interface{}, Store) interface{}
	Destination() string
}

type Transfers added in v1.6.0

type Transfers map[string]Transfer

func (*Transfers) Add added in v1.6.0

func (t *Transfers) Add(name string, transfer Transfer) *Transfers

func (*Transfers) Delete added in v1.6.0

func (t *Transfers) Delete(names ...string) *Transfers

type Transform added in v1.6.0

type Transform struct {
	Key  string
	Func func(interface{}, Store) interface{}
}

func NewTransform added in v1.6.0

func NewTransform() *Transform

func (*Transform) Destination added in v1.6.0

func (t *Transform) Destination() string

func (*Transform) SetFunc added in v1.6.0

func (t *Transform) SetFunc(fn func(interface{}, Store) interface{}) *Transform

func (*Transform) SetKey added in v1.6.0

func (t *Transform) SetKey(key string) *Transform

func (*Transform) Transform added in v1.6.0

func (t *Transform) Transform(v interface{}, r Store) interface{}

Jump to

Keyboard shortcuts

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