Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FieldName ¶ added in v1.10.0
func FieldName(field reflect.StructField) string
Types ¶
type Config ¶
type Config struct { Env interface{} Types TypesTable MapEnv bool DefaultType reflect.Type Operators OperatorsTable Expect reflect.Kind ExpectAny bool Optimize bool Strict bool Pipes bool ConstFns map[string]reflect.Value Visitors []ast.Visitor Functions map[string]*builtin.Function Builtins map[string]*builtin.Function Disabled map[string]bool // disabled builtins }
func CreateNew ¶ added in v1.11.0
func CreateNew() *Config
CreateNew creates new config with default values.
type OperatorPatcher ¶ added in v1.10.0
type OperatorPatcher struct { Operators OperatorsTable Types TypesTable }
func (*OperatorPatcher) Visit ¶ added in v1.10.0
func (p *OperatorPatcher) Visit(node *ast.Node)
type OperatorsTable ¶
OperatorsTable maps binary operators to corresponding list of functions. Functions should be provided in the environment to allow operator overloading.
type TypesTable ¶
func CreateTypesTable ¶
func CreateTypesTable(i interface{}) TypesTable
CreateTypesTable creates types table for type checks during parsing. If struct is passed, all fields will be treated as variables, as well as all fields of embedded structs and struct itself.
If map is passed, all items will be treated as variables (key as name, value as type).
func FieldsFromStruct ¶
func FieldsFromStruct(t reflect.Type) TypesTable
Click to show internal directories.
Click to hide internal directories.