param

package
v1.24.1 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: Apache-2.0 Imports: 11 Imported by: 292

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 DefaultTransferFuncs = map[string]func(value any, row Store) any{}
View Source
var EmptyTime = time.Time{}
View Source
var Ignored = &StringerIgnore{}

Functions

func AsBool added in v1.4.3

func AsBool(val any) bool

func AsBytes added in v1.5.0

func AsBytes(val any) []byte

func AsCSS added in v1.4.3

func AsCSS(val any) template.CSS

func AsDateTime added in v1.4.3

func AsDateTime(val any, layouts ...string) time.Time

func AsDuration added in v1.6.0

func AsDuration(val any, defaults ...time.Duration) time.Duration

func AsFloat32 added in v1.4.3

func AsFloat32(val any) float32

func AsFloat64 added in v1.4.3

func AsFloat64(val any) float64

func AsHTML added in v1.4.3

func AsHTML(val any) template.HTML

func AsHTMLAttr added in v1.4.3

func AsHTMLAttr(val any) template.HTMLAttr

func AsInt added in v1.4.3

func AsInt(val any) int

func AsInt8 added in v1.4.3

func AsInt8(val any) int8

func AsInt16 added in v1.4.3

func AsInt16(val any) int16

func AsInt32 added in v1.4.3

func AsInt32(val any) int32

func AsInt64 added in v1.4.3

func AsInt64(val any) int64

func AsInterfaces added in v1.6.0

func AsInterfaces[T any](p []T, converter ...func(s T) any) []any

func AsJS added in v1.4.3

func AsJS(val any) template.JS

func AsStdStringSlice added in v1.6.0

func AsStdStringSlice(p any) []string

AsStdStringSlice p must be slice

func AsString added in v1.4.3

func AsString(val any) string

func AsStringer added in v1.24.0

func AsStringer(v any, encoder ...formatter.Encoder) fmt.Stringer

func AsTimestamp added in v1.4.3

func AsTimestamp(val any) time.Time

func AsType added in v1.5.0

func AsType(typ string, val any) any

func AsUint added in v1.4.3

func AsUint(val any) uint

func AsUint8 added in v1.4.3

func AsUint8(val any) uint8

func AsUint16 added in v1.4.3

func AsUint16(val any) uint16

func AsUint32 added in v1.4.3

func AsUint32(val any) uint32

func AsUint64 added in v1.4.3

func AsUint64(val any) uint64

func Converts added in v1.6.0

func Converts[V Scalar, T Scalar](p []T, converter ...func(s T) V) []V

Converts 转换 Slice (不支持指针类型元素)

func Decr added in v1.4.3

func Decr(val any, n int64) int64

func FilterSlice added in v1.6.5

func FilterSlice[T comparable, F func(_ int, v T) bool](p []T, f F) []T

func GetByIndex added in v1.6.0

func GetByIndex(v any, i int, defaults ...any) any

func Incr added in v1.4.3

func Incr(val any, n int64) int64

func InterfacesTo added in v1.6.0

func InterfacesTo[T Scalar](p []any, converter ...func(s any) T) []T

func IsFalseBoolElement added in v1.6.0

func IsFalseBoolElement(_ int, s bool) bool

func IsGreaterThanZeroElement added in v1.6.0

func IsGreaterThanZeroElement[T Number](_ int, v T) bool

func IsNotEmptyString added in v1.6.0

func IsNotEmptyString(s *string) bool

func IsNotEmptyStringElement added in v1.6.0

func IsNotEmptyStringElement(_ int, s string) bool

func IsTrueBoolElement added in v1.6.0

func IsTrueBoolElement(_ int, s bool) bool

func RegisterTransferFunc added in v1.6.0

func RegisterTransferFunc(name string, fn func(value any, row Store) any)

func SetMapItems added in v1.23.3

func SetMapItems[T ~map[string]any](mapData T, keyValue ...any)

func Unique added in v1.6.0

func Unique[T comparable](p []T) []T

func UniqueWithFilter added in v1.6.5

func UniqueWithFilter[T comparable, F func(_ int, v T) bool](p []T, f F) []T

Types

type AsMap added in v1.6.0

type AsMap interface {
	AsMap() Store
}

type AsPartialMap added in v1.6.0

type AsPartialMap interface {
	AsMap(...string) Store
}

type Ignorer added in v1.6.0

type Ignorer interface {
	Ignore() bool
}

type MapReadonly added in v1.6.0

type MapReadonly map[string]any

func (MapReadonly) Bool added in v1.6.0

func (s MapReadonly) Bool(key string, defaults ...any) bool

func (MapReadonly) CSS added in v1.6.0

func (s MapReadonly) CSS(key string, defaults ...any) template.CSS

func (MapReadonly) Children added in v1.6.0

func (s MapReadonly) Children(keys ...any) MapReadonly

func (MapReadonly) DateTime added in v1.6.0

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

func (MapReadonly) Duration added in v1.6.0

func (s MapReadonly) Duration(key string, defaults ...time.Duration) time.Duration

func (MapReadonly) Float32 added in v1.6.0

func (s MapReadonly) Float32(key string, defaults ...any) float32

func (MapReadonly) Float64 added in v1.6.0

func (s MapReadonly) Float64(key string, defaults ...any) float64

func (MapReadonly) Get added in v1.6.0

func (s MapReadonly) Get(key string, defaults ...any) any

func (MapReadonly) GetStore added in v1.6.0

func (s MapReadonly) GetStore(key string, defaults ...any) MapReadonly

func (MapReadonly) GetStoreByKeys added in v1.6.0

func (s MapReadonly) GetStoreByKeys(keys ...string) MapReadonly

func (MapReadonly) HTML added in v1.6.0

func (s MapReadonly) HTML(key string, defaults ...any) template.HTML

func (MapReadonly) HTMLAttr added in v1.6.0

func (s MapReadonly) HTMLAttr(key string, defaults ...any) template.HTMLAttr

func (MapReadonly) Has added in v1.6.0

func (s MapReadonly) Has(key string) bool

func (MapReadonly) Int added in v1.6.0

func (s MapReadonly) Int(key string, defaults ...any) int

func (MapReadonly) Int8 added in v1.6.0

func (s MapReadonly) Int8(key string, defaults ...any) int8

func (MapReadonly) Int16 added in v1.6.0

func (s MapReadonly) Int16(key string, defaults ...any) int16

func (MapReadonly) Int32 added in v1.6.0

func (s MapReadonly) Int32(key string, defaults ...any) int32

func (MapReadonly) Int64 added in v1.6.0

func (s MapReadonly) Int64(key string, defaults ...any) int64

func (MapReadonly) JS added in v1.6.0

func (s MapReadonly) JS(key string, defaults ...any) template.JS

func (MapReadonly) MarshalXML added in v1.6.0

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

MarshalXML allows type MapReadonly to be used with xml.Marshal

func (MapReadonly) Select added in v1.6.0

func (s MapReadonly) Select(selectKeys ...string) MapReadonly

func (MapReadonly) Split added in v1.6.0

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

func (MapReadonly) String added in v1.6.0

func (s MapReadonly) String(key string, defaults ...any) string

func (MapReadonly) Timestamp added in v1.6.0

func (s MapReadonly) Timestamp(key string, defaults ...any) time.Time

func (MapReadonly) Trim added in v1.6.0

func (s MapReadonly) Trim(key string, defaults ...any) String

func (MapReadonly) Uint added in v1.6.0

func (s MapReadonly) Uint(key string, defaults ...any) uint

func (MapReadonly) Uint8 added in v1.6.0

func (s MapReadonly) Uint8(key string, defaults ...any) uint8

func (MapReadonly) Uint16 added in v1.6.0

func (s MapReadonly) Uint16(key string, defaults ...any) uint16

func (MapReadonly) Uint32 added in v1.6.0

func (s MapReadonly) Uint32(key string, defaults ...any) uint32

func (MapReadonly) Uint64 added in v1.6.0

func (s MapReadonly) Uint64(key string, defaults ...any) uint64

type Number added in v1.6.0

type Number interface {
	~uint8 | ~int8 | ~uint16 | ~int16 | ~uint32 | ~int32 | ~uint | ~int | ~uint64 | ~int64 | ~float32 | ~float64
}

type SafeMap added in v1.5.0

type SafeMap struct {
	*com.SafeMap[any, any]
}

func NewMap added in v1.5.0

func NewMap() *SafeMap

func (*SafeMap) Bool added in v1.5.0

func (s *SafeMap) Bool(key any, defaults ...any) bool

func (*SafeMap) CSS added in v1.5.0

func (s *SafeMap) CSS(key any, defaults ...any) template.CSS

func (*SafeMap) DateTime added in v1.5.0

func (s *SafeMap) DateTime(key any, layouts ...string) time.Time

func (*SafeMap) Decr added in v1.5.0

func (s *SafeMap) Decr(key any, n int64, defaults ...any) int64

func (*SafeMap) Float32 added in v1.5.0

func (s *SafeMap) Float32(key any, defaults ...any) float32

func (*SafeMap) Float64 added in v1.5.0

func (s *SafeMap) Float64(key any, defaults ...any) float64

func (*SafeMap) Get added in v1.5.0

func (s *SafeMap) Get(key any, defaults ...any) any

func (*SafeMap) GetOrSet added in v1.5.0

func (s *SafeMap) GetOrSet(key, value any) (actual any, loaded bool)

GetOrSet get or set

value: `func() any` or `func() (any, bool)` or other

func (*SafeMap) GetStore added in v1.6.0

func (s *SafeMap) GetStore(key any, defaults ...any) Store

func (*SafeMap) HTML added in v1.5.0

func (s *SafeMap) HTML(key any, defaults ...any) template.HTML

func (*SafeMap) HTMLAttr added in v1.5.0

func (s *SafeMap) HTMLAttr(key any, defaults ...any) template.HTMLAttr

func (*SafeMap) Has added in v1.5.0

func (s *SafeMap) Has(key any) bool

func (*SafeMap) Incr added in v1.5.0

func (s *SafeMap) Incr(key any, n int64, defaults ...any) int64

func (*SafeMap) Int added in v1.5.0

func (s *SafeMap) Int(key any, defaults ...any) int

func (*SafeMap) Int8 added in v1.5.0

func (s *SafeMap) Int8(key any, defaults ...any) int8

func (*SafeMap) Int16 added in v1.5.0

func (s *SafeMap) Int16(key any, defaults ...any) int16

func (*SafeMap) Int32 added in v1.5.0

func (s *SafeMap) Int32(key any, defaults ...any) int32

func (*SafeMap) Int64 added in v1.5.0

func (s *SafeMap) Int64(key any, defaults ...any) int64

func (*SafeMap) JS added in v1.5.0

func (s *SafeMap) JS(key any, defaults ...any) template.JS

func (*SafeMap) Load added in v1.11.1

func (s *SafeMap) Load(key any) (actual any, loaded bool)

func (*SafeMap) LoadOrStore added in v1.11.1

func (s *SafeMap) LoadOrStore(key, value any) (actual any, loaded bool)

LoadOrStore load or store

value: `func() any` or `func() (any, bool)` or other

func (*SafeMap) Split added in v1.5.0

func (s *SafeMap) Split(key any, sep string, limit ...int) StringSlice

func (*SafeMap) Store added in v1.11.2

func (s *SafeMap) Store(key, value any)

func (*SafeMap) String added in v1.5.0

func (s *SafeMap) String(key any, defaults ...any) string

func (*SafeMap) Timestamp added in v1.5.0

func (s *SafeMap) Timestamp(key any, defaults ...any) time.Time

func (*SafeMap) Trim added in v1.5.0

func (s *SafeMap) Trim(key any, defaults ...any) String

func (*SafeMap) Uint added in v1.5.0

func (s *SafeMap) Uint(key any, defaults ...any) uint

func (*SafeMap) Uint8 added in v1.5.0

func (s *SafeMap) Uint8(key any, defaults ...any) uint8

func (*SafeMap) Uint16 added in v1.5.0

func (s *SafeMap) Uint16(key any, defaults ...any) uint16

func (*SafeMap) Uint32 added in v1.5.0

func (s *SafeMap) Uint32(key any, defaults ...any) uint32

func (*SafeMap) Uint64 added in v1.5.0

func (s *SafeMap) Uint64(key any, defaults ...any) uint64

type SafeStore added in v1.6.0

type SafeStore struct {
	// contains filtered or unexported fields
}

func NewSafeStore added in v1.6.0

func NewSafeStore(data ...Store) *SafeStore

func (*SafeStore) Bool added in v1.6.0

func (s *SafeStore) Bool(key string, defaults ...any) bool

func (*SafeStore) CSS added in v1.6.0

func (s *SafeStore) CSS(key string, defaults ...any) template.CSS

func (*SafeStore) Children added in v1.6.0

func (s *SafeStore) Children(keys ...any) Store

func (*SafeStore) Clear added in v1.6.0

func (s *SafeStore) Clear() *SafeStore

func (*SafeStore) Clone added in v1.6.0

func (s *SafeStore) Clone() *SafeStore

func (*SafeStore) CloneStore added in v1.6.0

func (s *SafeStore) CloneStore() Store

func (*SafeStore) DateTime added in v1.6.0

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

func (*SafeStore) Decr added in v1.6.0

func (s *SafeStore) Decr(key string, n int64, defaults ...any) int64

func (*SafeStore) DeepMerge added in v1.6.0

func (s *SafeStore) DeepMerge(source Store)

func (*SafeStore) Delete added in v1.6.0

func (c *SafeStore) Delete(keys ...string)

Delete saves data

func (*SafeStore) Duration added in v1.6.0

func (s *SafeStore) Duration(key string, defaults ...time.Duration) time.Duration

func (*SafeStore) Float32 added in v1.6.0

func (s *SafeStore) Float32(key string, defaults ...any) float32

func (*SafeStore) Float64 added in v1.6.0

func (s *SafeStore) Float64(key string, defaults ...any) float64

func (*SafeStore) Get added in v1.6.0

func (s *SafeStore) Get(key string, defaults ...any) any

Get retrieves data

func (*SafeStore) GetStore added in v1.6.0

func (s *SafeStore) GetStore(key string, defaults ...any) Store

func (*SafeStore) GetStoreByKeys added in v1.6.0

func (s *SafeStore) GetStoreByKeys(keys ...string) Store

func (*SafeStore) HTML added in v1.6.0

func (s *SafeStore) HTML(key string, defaults ...any) template.HTML

func (*SafeStore) HTMLAttr added in v1.6.0

func (s *SafeStore) HTMLAttr(key string, defaults ...any) template.HTMLAttr

func (*SafeStore) Has added in v1.6.0

func (s *SafeStore) Has(key string) bool

func (*SafeStore) Incr added in v1.6.0

func (s *SafeStore) Incr(key string, n int64, defaults ...any) int64

func (*SafeStore) Int added in v1.6.0

func (s *SafeStore) Int(key string, defaults ...any) int

func (*SafeStore) Int8 added in v1.6.0

func (s *SafeStore) Int8(key string, defaults ...any) int8

func (*SafeStore) Int16 added in v1.6.0

func (s *SafeStore) Int16(key string, defaults ...any) int16

func (*SafeStore) Int32 added in v1.6.0

func (s *SafeStore) Int32(key string, defaults ...any) int32

func (*SafeStore) Int64 added in v1.6.0

func (s *SafeStore) Int64(key string, defaults ...any) int64

func (*SafeStore) JS added in v1.6.0

func (s *SafeStore) JS(key string, defaults ...any) template.JS

func (*SafeStore) MarshalXML added in v1.6.0

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

MarshalXML allows type Store to be used with xml.Marshal

func (*SafeStore) Range added in v1.6.0

func (s *SafeStore) Range(fn func(key string, val any) error) (err error)

func (*SafeStore) Select added in v1.6.0

func (s *SafeStore) Select(selectKeys ...string) Store

func (*SafeStore) Set added in v1.6.0

func (s *SafeStore) Set(key string, val any)

Set saves data

func (*SafeStore) SetMKey added in v1.6.0

func (s *SafeStore) SetMKey(key string, value any) *SafeStore

func (*SafeStore) SetMKeys added in v1.6.0

func (s *SafeStore) SetMKeys(keys []string, value any) *SafeStore

func (*SafeStore) SetMore added in v1.23.3

func (s *SafeStore) SetMore(keyVal ...any)

func (*SafeStore) Split added in v1.6.0

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

func (*SafeStore) Stored added in v1.6.0

func (s *SafeStore) Stored() Store

func (*SafeStore) String added in v1.6.0

func (s *SafeStore) String(key string, defaults ...any) string

func (*SafeStore) Timestamp added in v1.6.0

func (s *SafeStore) Timestamp(key string, defaults ...any) time.Time

func (*SafeStore) Transform added in v1.6.0

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

func (*SafeStore) Trim added in v1.6.0

func (s *SafeStore) Trim(key string, defaults ...any) String

func (*SafeStore) Uint added in v1.6.0

func (s *SafeStore) Uint(key string, defaults ...any) uint

func (*SafeStore) Uint8 added in v1.6.0

func (s *SafeStore) Uint8(key string, defaults ...any) uint8

func (*SafeStore) Uint16 added in v1.6.0

func (s *SafeStore) Uint16(key string, defaults ...any) uint16

func (*SafeStore) Uint32 added in v1.6.0

func (s *SafeStore) Uint32(key string, defaults ...any) uint32

func (*SafeStore) Uint64 added in v1.6.0

func (s *SafeStore) Uint64(key string, defaults ...any) uint64

type Scalar added in v1.6.0

type Scalar interface {
	Number | ~bool | ~string
}

type Store added in v1.5.0

type Store map[string]any

func AsStore added in v1.5.0

func AsStore(val any) Store

func AsStoreOrNil added in v1.23.3

func AsStoreOrNil(val any) Store

func StoreStart added in v1.6.0

func StoreStart() Store

func (Store) Bool added in v1.5.0

func (s Store) Bool(key string, defaults ...any) bool

func (Store) CSS added in v1.5.0

func (s Store) CSS(key string, defaults ...any) template.CSS

func (Store) Children added in v1.5.0

func (s Store) Children(keys ...any) 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 ...any) 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) Store

func (Store) Duration added in v1.6.0

func (s Store) Duration(key string, defaults ...time.Duration) time.Duration

func (Store) Float32 added in v1.5.0

func (s Store) Float32(key string, defaults ...any) float32

func (Store) Float64 added in v1.5.0

func (s Store) Float64(key string, defaults ...any) float64

func (Store) Get added in v1.5.0

func (s Store) Get(key string, defaults ...any) any

func (Store) GetStore added in v1.6.0

func (s Store) GetStore(key string, defaults ...any) Store

func (Store) GetStoreByKeys added in v1.6.0

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

func (Store) HTML added in v1.5.0

func (s Store) HTML(key string, defaults ...any) template.HTML

func (Store) HTMLAttr added in v1.5.0

func (s Store) HTMLAttr(key string, defaults ...any) 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 ...any) int64

func (Store) Int added in v1.5.0

func (s Store) Int(key string, defaults ...any) int

func (Store) Int8 added in v1.5.0

func (s Store) Int8(key string, defaults ...any) int8

func (Store) Int16 added in v1.5.0

func (s Store) Int16(key string, defaults ...any) int16

func (Store) Int32 added in v1.5.0

func (s Store) Int32(key string, defaults ...any) int32

func (Store) Int64 added in v1.5.0

func (s Store) Int64(key string, defaults ...any) int64

func (Store) JS added in v1.5.0

func (s Store) JS(key string, defaults ...any) 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) Select added in v1.6.0

func (s Store) Select(selectKeys ...string) Store

func (Store) Set added in v1.5.0

func (s Store) Set(key string, value any) Store

func (Store) SetMKey added in v1.6.0

func (s Store) SetMKey(key string, value any) Store

func (Store) SetMKeys added in v1.6.0

func (s Store) SetMKeys(keys []string, value any) Store

func (Store) SetMore added in v1.23.3

func (s Store) SetMore(keyValue ...any) Store

func (Store) Split added in v1.5.0

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

func (Store) String added in v1.5.0

func (s Store) String(key string, defaults ...any) string

func (Store) Timestamp added in v1.5.0

func (s Store) Timestamp(key string, defaults ...any) 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 ...any) String

func (Store) Uint added in v1.5.0

func (s Store) Uint(key string, defaults ...any) uint

func (Store) Uint8 added in v1.5.0

func (s Store) Uint8(key string, defaults ...any) uint8

func (Store) Uint16 added in v1.5.0

func (s Store) Uint16(key string, defaults ...any) uint16

func (Store) Uint32 added in v1.5.0

func (s Store) Uint32(key string, defaults ...any) uint32

func (Store) Uint64 added in v1.5.0

func (s Store) Uint64(key string, defaults ...any) uint64

type String

type String string

func Trim added in v1.4.3

func Trim(val any) 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) Duration added in v1.6.0

func (p String) Duration(defaults ...time.Duration) time.Duration

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() any

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) SplitAny added in v1.6.0

func (p String) SplitAny(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) Duration added in v1.6.0

func (p StringMap) Duration(key string, defaults ...time.Duration) time.Duration

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) any

func (StringMap) Interfaces added in v1.4.0

func (p StringMap) Interfaces() map[string]any

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) SplitAny added in v1.6.0

func (p StringMap) SplitAny(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 any, 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) Filter added in v1.6.0

func (p StringSlice) Filter(filterFuncs ...func(s *string) bool) StringSlice

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 any) bool

func (StringSlice) Int added in v1.3.0

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

func (StringSlice) Int8 added in v1.6.0

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

func (StringSlice) Int16 added in v1.6.0

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

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) []any

func (StringSlice) Join added in v1.4.2

func (p StringSlice) Join(sep string) string

func (StringSlice) Size added in v1.6.0

func (p StringSlice) Size() int

func (StringSlice) Split added in v1.6.0

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

func (StringSlice) SplitAny added in v1.6.0

func (p StringSlice) SplitAny(sep string, limit ...int) StringSlice

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) Uint8 added in v1.6.0

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

func (StringSlice) Uint16 added in v1.6.0

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

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

func (StringSlice) Unique added in v1.6.0

func (p StringSlice) Unique() StringSlice

type Stringer added in v1.6.0

type Stringer interface {
	String(v any) string
}

func DateTimeStringer added in v1.6.0

func DateTimeStringer(layouts ...string) Stringer

func TimestampStringer added in v1.6.0

func TimestampStringer(layouts ...string) Stringer

func WhitespaceStringer added in v1.6.0

func WhitespaceStringer() Stringer

type StringerFunc added in v1.6.0

type StringerFunc func(any) string

func (StringerFunc) String added in v1.6.0

func (f StringerFunc) String(v any) string

type StringerIgnore added in v1.6.0

type StringerIgnore struct{}

func (*StringerIgnore) Ignore added in v1.6.0

func (s *StringerIgnore) Ignore() bool

func (*StringerIgnore) String added in v1.6.0

func (s *StringerIgnore) String(_ any) string

type StringerList added in v1.6.0

type StringerList []Stringer

func (StringerList) Ignore added in v1.6.0

func (s StringerList) Ignore() bool

func (StringerList) Size added in v1.6.0

func (s StringerList) Size() int

func (StringerList) String added in v1.6.0

func (s StringerList) String(v any) string

type StringerMap added in v1.6.0

type StringerMap map[string]Stringer

func StringerMapStart added in v1.6.0

func StringerMapStart() StringerMap

func (StringerMap) Add added in v1.6.0

func (s StringerMap) Add(key string, value Stringer) StringerMap

func (StringerMap) AddFunc added in v1.6.0

func (s StringerMap) AddFunc(key string, value func(any) string) StringerMap

func (StringerMap) Delete added in v1.6.0

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

func (StringerMap) Get added in v1.6.0

func (s StringerMap) Get(key string, defaults ...Stringer) Stringer

func (StringerMap) Has added in v1.6.0

func (s StringerMap) Has(key string) bool

func (StringerMap) Set added in v1.6.0

func (s StringerMap) Set(key string, value Stringer) StringerMap

func (StringerMap) SetFunc added in v1.6.0

func (s StringerMap) SetFunc(key string, value func(any) string) StringerMap

func (StringerMap) String added in v1.6.0

func (s StringerMap) String(key string, value any) (result string, found bool, ignore bool)

type Transfer added in v1.6.0

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

type Transfers added in v1.6.0

type Transfers map[string]Transfer

Transfers {oldField:Transfer}

func NewTransfers added in v1.6.0

func NewTransfers() *Transfers

func TransformCamelCase added in v1.6.0

func TransformCamelCase(keys ...string) Transfers

func TransformCase added in v1.6.0

func TransformCase(keyTransfer func(string) string, keys ...string) Transfers

func TransformLowerCaseFirst added in v1.6.0

func TransformLowerCaseFirst(keys ...string) Transfers

func TransformSnakeCase added in v1.6.0

func TransformSnakeCase(keys ...string) Transfers

func (*Transfers) Add added in v1.6.0

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

func (*Transfers) AddFunc added in v1.6.0

func (t *Transfers) AddFunc(oldField string, fn func(value any, row Store) any, newField ...string) *Transfers

func (*Transfers) AsMap added in v1.6.0

func (t *Transfers) AsMap() Transfers

func (*Transfers) Delete added in v1.6.0

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

func (*Transfers) Transform added in v1.6.0

func (t *Transfers) Transform(row Store) Store

type Transform added in v1.6.0

type Transform struct {
	Key  string                         // new field
	Func func(value any, row Store) any `json:"-" xml:"-"`
}

func NewTransform added in v1.6.0

func NewTransform() *Transform

func Tf added in v1.6.0

func Tf(key string, fn func(value any, row Store) any) *Transform

func (*Transform) Destination added in v1.6.0

func (t *Transform) Destination() string

func (*Transform) Set added in v1.6.0

func (t *Transform) Set(key string, fn func(value any, row Store) any) *Transform

func (*Transform) SetFunc added in v1.6.0

func (t *Transform) SetFunc(fn func(value any, row Store) any) *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(value any, row Store) any

Jump to

Keyboard shortcuts

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