Documentation
¶
Index ¶
- Variables
- type Entry
- type Errors
- func (e Errors) AssertBool(value interface{}) (bool, error)
- func (e Errors) AssertFloat(value interface{}) (bool, error)
- func (e Errors) AssertInt(value interface{}) (bool, error)
- func (e Errors) AssertString(value interface{}) (bool, error)
- func (e Errors) AssertWithMessage(isValid bool, message string) (bool, error)
- func (e Errors) DiscoverInterfaces(aFunc interface{}) (func(args ...interface{}) (interface{}, error), reflect.Type, bool)
- func (e Errors) Raise(message string) (string, error)
- func (e Errors) RegisterError(message string) (string, error)
- type FieldNameChecker
- type FunctionKindMetadata
- type FunctionNamespaceMetadata
- type JSON
- type Maps
- func (m Maps) Get(aMap interface{}, key interface{}) (interface{}, error)
- func (m Maps) GetBool(aMap interface{}, key interface{}) (bool, error)
- func (m Maps) GetFloat(aMap interface{}, key interface{}) (float64, error)
- func (m Maps) GetInt(aMap interface{}, key interface{}) (int, error)
- func (m Maps) GetString(aMap interface{}, key interface{}) (string, error)
- func (m Maps) Has(aMap interface{}, key interface{}) (bool, error)
- type Math
- func (m Math) Abs(f float64) float64
- func (m Math) Ceil(f float64) float64
- func (m Math) DiscoverInterfaces(aFunc interface{}) (func(args ...interface{}) (interface{}, error), reflect.Type, bool)
- func (m Math) Floor(f float64) float64
- func (m Math) Max(x, y float64) float64
- func (m Math) Min(x, y float64) float64
- func (m Math) Pow(x, y float64) float64
- func (m Math) Round(f float64) float64
- func (m Math) Sqrt(f float64) float64
- type Registry
- type Slices
- func (s Slices) BoolAt(slice interface{}, index int) (bool, error)
- func (s Slices) FloatAt(slice interface{}, index int) (float64, error)
- func (s Slices) IntAt(slice interface{}, index int) (int, error)
- func (s Slices) Length(slice interface{}) int
- func (s Slices) ReverseFloats(slice interface{}) ([]float64, error)
- func (s Slices) ReverseInts(slice interface{}) ([]int, error)
- func (s Slices) ReverseStrings(slice interface{}) ([]string, error)
- func (s Slices) StringAt(slice interface{}, index int) (string, error)
- type StaticKindFunc
- type Strconv
- func (s Strconv) AsFloat(value interface{}) (float64, error)
- func (s Strconv) Atoi(val string) (int, error)
- func (s Strconv) Itoa(i int) string
- func (s Strconv) ParseBool(val string) (bool, error)
- func (s Strconv) ParseFloat(val string) (float64, error)
- func (s Strconv) ParseUint(val string) (uint64, error)
- type Strings
- func (s Strings) Fields(val string) []string
- func (s Strings) HasPrefix(val, suffix string) bool
- func (s Strings) HasSuffix(val, suffix string) bool
- func (s Strings) In(set []string, candidate string) bool
- func (s Strings) Index(val, substr string) int
- func (s Strings) LastIndex(val, substr string) int
- func (s Strings) Length(val string) int
- func (s Strings) ReplaceAll(val, old, new string) string
- func (s Strings) Split(val, sep string) []string
- func (s Strings) ToLower(val string) string
- func (s Strings) ToUpper(val string) string
- func (s Strings) Trim(val, cutset string) string
- func (s Strings) TrimSpace(val string) string
- type Time
- type TypeParser
- type Types
Constants ¶
This section is empty.
Variables ¶
View Source
var FuncErrors = registryInstance.DefineNs("errors", NewEntry( &Errors{}, NewFunctionNamespace(reflect.TypeOf(&Errors{})), ))
View Source
var FuncJSON = registryInstance.DefineNs("json", NewEntry( NewJSON(nil), NewFunctionNamespace(reflect.TypeOf(NewJSON(nil))), ))
View Source
var FuncMaps = registryInstance.DefineNs("maps", NewEntry( &Maps{}, NewFunctionNamespace(reflect.TypeOf(&Maps{})), ))
View Source
var FuncMath = registryInstance.DefineNs("math", NewEntry( &Math{}, NewFunctionNamespace(reflect.TypeOf(&Math{})), ))
View Source
var FuncSlices = registryInstance.DefineNs("slices", NewEntry( &Slices{}, NewFunctionNamespace(reflect.TypeOf(&Slices{})), ))
View Source
var FuncStrconv = registryInstance.DefineNs("strconv", NewEntry( &Strconv{}, NewFunctionNamespace(reflect.TypeOf(&Strconv{})), ))
View Source
var FuncStrings = registryInstance.DefineNs("strings", NewEntry( &Strings{}, NewFunctionNamespace(reflect.TypeOf(&Strings{})), ))
View Source
var FuncTime = registryInstance.DefineNs("time", NewEntry( &Time{}, NewFunctionNamespace(reflect.TypeOf(&Time{})), ))
View Source
var FuncTypes = registryInstance.DefineNs("types", NewEntry( &Types{}, NewFunctionNamespace(reflect.TypeOf(&Types{})), ))
View Source
var HasKeyFunc = &StaticKindFunc{ kind: reflect.Map, handler: func(aMap, aKey interface{}) (bool, error) { return reflect.ValueOf(aMap).MapIndex(reflect.ValueOf(keys.Normalize(aKey))).IsValid(), nil }, resultType: reflect.TypeOf(true), }
View Source
var MapHasKey = registryInstance.DefineNs("HasKey", NewEntry( HasKeyFunc.handler, NewFunctionKind([]reflect.Kind{HasKeyFunc.kind}), ))
View Source
var (
Now = time.Now
)
View Source
var SliceIndexBy = registryInstance.DefineNs("IndexBy", NewEntry( SliceIndexByFunc.Handler(), NewFunctionKind(SliceIndexByFunc.Kind()), ))
View Source
var SliceIndexByFunc = &indexSliceByFunc{}
Functions ¶
This section is empty.
Types ¶
type Errors ¶
type Errors struct { }
func (Errors) AssertBool ¶
func (Errors) AssertFloat ¶
func (Errors) AssertString ¶
func (Errors) AssertWithMessage ¶
func (Errors) DiscoverInterfaces ¶
type FieldNameChecker ¶
type FieldNameChecker func(field reflect.StructField, fieldName string) bool
var FieldChecker FieldNameChecker = func(field reflect.StructField, fieldName string) bool { return false }
type FunctionKindMetadata ¶
type FunctionKindMetadata struct {
// contains filtered or unexported fields
}
func NewFunctionKind ¶
func NewFunctionKind(kinds []reflect.Kind) *FunctionKindMetadata
func (*FunctionKindMetadata) Kinds ¶
func (f *FunctionKindMetadata) Kinds() []reflect.Kind
type FunctionNamespaceMetadata ¶
type FunctionNamespaceMetadata struct {
// contains filtered or unexported fields
}
func NewFunctionNamespace ¶
func NewFunctionNamespace(rType reflect.Type) *FunctionNamespaceMetadata
func (*FunctionNamespaceMetadata) Type ¶
func (f *FunctionNamespaceMetadata) Type() reflect.Type
type JSON ¶
type JSON struct {
// contains filtered or unexported fields
}
func NewJSON ¶
func NewJSON(typeParser TypeParser) *JSON
func (*JSON) MethodResultType ¶
func (*JSON) UnmarshalInto ¶
type Registry ¶
func CopyInstance ¶
func CopyInstance() *Registry
func NewRegistry ¶
func NewRegistry() *Registry
type Slices ¶
type Slices struct { }
func (Slices) ReverseFloats ¶
func (Slices) ReverseInts ¶
func (Slices) ReverseStrings ¶
type StaticKindFunc ¶
type StaticKindFunc struct {
// contains filtered or unexported fields
}
func (*StaticKindFunc) Handler ¶
func (a *StaticKindFunc) Handler() interface{}
func (*StaticKindFunc) Kind ¶
func (a *StaticKindFunc) Kind() []reflect.Kind
type TypeParser ¶
TypeParser parses type string representation into reflect.Type
Click to show internal directories.
Click to hide internal directories.