Documentation
¶
Index ¶
- Constants
- Variables
- func Any(kinds map[string]any) value.Value
- func Atoi(_ context.Context, args []value.Value) (value.Value, bool, error)
- func Base64(_ context.Context, args []value.Value) (value.Value, bool, error)
- func Base64Decode(_ context.Context, args []value.Value) (value.Value, bool, error)
- func Basename(_ context.Context, args []value.Value) (value.Value, bool, error)
- func Break() value.Value
- func Catch(ctx context.Context, args []value.Value) (value.Value, bool, error)
- func Contains(ctx context.Context, args []value.Value) (value.Value, bool, error)
- func Cut(_ context.Context, args []value.Value) (value.Value, bool, error)
- func Debug(_ context.Context, args []value.Value) (value.Value, bool, error)
- func Describe(ctx context.Context, args []value.Value) (value.Value, bool, error)
- func Dirname(_ context.Context, args []value.Value) (value.Value, bool, error)
- func EndsWith(_ context.Context, args []value.Value) (value.Value, bool, error)
- func Enum(_ context.Context, args []value.Value) (value.Value, bool, error)
- func Error(_ context.Context, args []value.Value) (value.Value, bool, error)
- func EvalExpr(ctx context.Context, expr Expression, opts ...EvalOption) (value.Value, bool, error)
- func EvalSchema(ctx context.Context, expr Expression) (value.Schema, bool, error)
- func FileExt(_ context.Context, args []value.Value) (value.Value, bool, error)
- func FromHex(_ context.Context, args []value.Value) (value.Value, bool, error)
- func FromJSON(_ context.Context, args []value.Value) (value.Value, bool, error)
- func FromYAML(_ context.Context, args []value.Value) (value.Value, bool, error)
- func IndexOf(_ context.Context, args []value.Value) (value.Value, bool, error)
- func Int() value.Value
- func IsA(ctx context.Context, args []value.Value) (value.Value, bool, error)
- func IsAllowNewKeys(ctx context.Context) bool
- func IsSchema(ctx context.Context) bool
- func Join(_ context.Context, args []value.Value) (value.Value, bool, error)
- func JoinHostPort(_ context.Context, args []value.Value) (value.Value, bool, error)
- func Keys(_ context.Context, args []value.Value) (value.Value, bool, error)
- func Len(_ context.Context, args []value.Value) (value.Value, bool, error)
- func Merge(_ context.Context, args []value.Value) (value.Value, bool, error)
- func Mod(_ context.Context, args []value.Value) (value.Value, bool, error)
- func NativeFuncValue(f func(context.Context, []value.Value) (value.Value, bool, error)) value.Value
- func NewErrUnknownError(node ast.Node) error
- func PathJoin(_ context.Context, args []value.Value) (value.Value, bool, error)
- func Range(_ context.Context, args []value.Value) (value.Value, bool, error)
- func Replace(_ context.Context, args []value.Value) (value.Value, bool, error)
- func Sha1sum(_ context.Context, args []value.Value) (value.Value, bool, error)
- func Sha256sum(_ context.Context, args []value.Value) (value.Value, bool, error)
- func Sha512sum(_ context.Context, args []value.Value) (value.Value, bool, error)
- func Skip() value.Value
- func Sort(ctx context.Context, args []value.Value) (value.Value, bool, error)
- func Split(_ context.Context, args []value.Value) (value.Value, bool, error)
- func SplitHostPort(_ context.Context, args []value.Value) (value.Value, bool, error)
- func StartsWith(_ context.Context, args []value.Value) (value.Value, bool, error)
- func ToHex(_ context.Context, args []value.Value) (value.Value, bool, error)
- func ToJSON(_ context.Context, args []value.Value) (value.Value, bool, error)
- func ToLower(_ context.Context, args []value.Value) (value.Value, bool, error)
- func ToTitle(_ context.Context, args []value.Value) (value.Value, bool, error)
- func ToUpper(_ context.Context, args []value.Value) (value.Value, bool, error)
- func ToYAML(_ context.Context, args []value.Value) (value.Value, bool, error)
- func Trim(_ context.Context, args []value.Value) (value.Value, bool, error)
- func TrimPrefix(_ context.Context, args []value.Value) (value.Value, bool, error)
- func TrimSuffix(_ context.Context, args []value.Value) (value.Value, bool, error)
- func WithAllowNewKeys(ctx context.Context, allowNewKeys bool) context.Context
- func WithSchema(ctx context.Context, schema bool) context.Context
- func WithScope(ctx context.Context, scope Scope) context.Context
- type Array
- type BuildOption
- type BuildOptions
- type Call
- type Comments
- type Default
- type Embedded
- type ErrInvalidArgument
- type ErrKeyNotFound
- type ErrUnknownError
- type ErrorValue
- type EvalOption
- type EvalOptions
- type Expression
- type Field
- type FieldKey
- type File
- type For
- type Function
- type FunctionDefinition
- type If
- type Index
- type Interpolation
- type IsArgumentDefinition
- type IsPositionalArgument
- type KeyValue
- type LambdaDefinition
- type Lookup
- type LoopControl
- type NativeFunc
- type Op
- type Parens
- type Path
- type PathElement
- type Schema
- type Scope
- type ScopeAsValue
- type ScopeData
- type ScopeFunc
- type ScopeStorage
- type Selector
- type Slice
- type Struct
- type Value
- type ValueScopeLookup
Constants ¶
View Source
const MaxCallDepth = 100
Variables ¶
View Source
var (
DebugEnabled = true
)
Functions ¶
func Base64Decode ¶
func EvalExpr ¶
func EvalExpr(ctx context.Context, expr Expression, opts ...EvalOption) (value.Value, bool, error)
func EvalSchema ¶
func IsAllowNewKeys ¶
func JoinHostPort ¶
func NativeFuncValue ¶
func NewErrUnknownError ¶
func SplitHostPort ¶
func WithAllowNewKeys ¶
Types ¶
type BuildOption ¶
type BuildOptions ¶
type BuildOptions []BuildOption
func (BuildOptions) Merge ¶
func (b BuildOptions) Merge() (merged BuildOption)
type Embedded ¶
type Embedded struct {
Pos value.Position
Comments Comments
Expression Expression
}
func (*Embedded) IsPositionalArgument ¶
type ErrInvalidArgument ¶
type ErrInvalidArgument struct {
Err error
}
func (*ErrInvalidArgument) Error ¶
func (e *ErrInvalidArgument) Error() string
type ErrKeyNotFound ¶
func (*ErrKeyNotFound) Error ¶
func (e *ErrKeyNotFound) Error() string
func (*ErrKeyNotFound) Unwrap ¶
func (e *ErrKeyNotFound) Unwrap() error
type ErrUnknownError ¶
func (*ErrUnknownError) Error ¶
func (e *ErrUnknownError) Error() string
type ErrorValue ¶
func (ErrorValue) Error ¶
func (e ErrorValue) Error() string
type EvalOption ¶
func (EvalOption) Complete ¶
func (e EvalOption) Complete() EvalOption
type EvalOptions ¶
type EvalOptions []EvalOption
func (EvalOptions) Merge ¶
func (e EvalOptions) Merge() (result EvalOption)
type Expression ¶
type Field ¶
type Field interface {
ToValueForIndex(ctx context.Context, idx int) (value.Value, bool, error)
Position() value.Position
// IsForLookup Should this field be added to the current scope and it's keys available as scope keys
IsForLookup(ctx context.Context) bool
// IsForValue Should this fields value be contributed to the rendered data
IsForValue(ctx context.Context) bool
}
type FieldKey ¶
type FieldKey struct {
Match Expression
Interpolation Expression
Key string
Pos value.Position
}
type For ¶
type For struct {
Comments Comments
Key string
Value string
Collection Expression
Body Expression
Else Expression
Merge bool
Position value.Position
}
type Function ¶
type Function struct {
Pos value.Position
Scope Scope
Body Expression
ReturnType Expression
ArgsSchema value.Schema
ArgNames value.Names
ProfilesSchema value.Schema
ProfileNames value.Names
FuncSchema *value.FuncSchema
ReturnBody bool
AssignRoot bool
UnscopedArgs bool
// contains filtered or unexported fields
}
type FunctionDefinition ¶
type If ¶
type If struct {
Pos value.Position
Comments Comments
Condition Expression
Value Expression
Else Expression
}
type Index ¶
type Index struct {
Comments Comments
Pos value.Position
Base Expression
Index Expression
}
type Interpolation ¶
type Interpolation struct {
Parts []any
}
type IsArgumentDefinition ¶
type IsArgumentDefinition interface {
IsArgumentDefinition() bool
}
type IsPositionalArgument ¶
type IsPositionalArgument interface {
IsPositionalArgument() bool
}
type KeyValue ¶
type KeyValue struct {
Comments Comments
Key FieldKey
Value Expression
Pos value.Position
Local bool
Optional bool
}
func (*KeyValue) IsArgumentDefinition ¶
type LambdaDefinition ¶
type LambdaDefinition struct {
Comments Comments
Pos value.Position
Vars []string
Body Expression
}
type LoopControl ¶
func (*LoopControl) Kind ¶
func (l *LoopControl) Kind() value.Kind
type Op ¶
type Op struct {
Unary bool
Comments Comments
Operator value.Operator
Left Expression
Right Expression
Pos value.Position
}
type Parens ¶
type Parens struct {
Comments Comments
Expr Expression
}
type PathElement ¶
type Schema ¶
type Schema struct {
Comments Comments
Expression Expression
AllowNewFields bool
}
type Scope ¶
type Scope interface {
Depth() int
IsRoot(ctx context.Context) (bool, error)
Get(ctx context.Context, key string) (value.Value, bool, error)
NewScope(ctx context.Context, data ScopeStorage) (Scope, context.Context)
}
var Builtin Scope
func EmptyScope ¶
type ScopeAsValue ¶
func (ScopeAsValue) Kind ¶
func (s ScopeAsValue) Kind() value.Kind
func (ScopeAsValue) LookupValue ¶
type ScopeStorage ¶
type Selector ¶
type Selector struct {
Comments Comments
Pos value.Position
Base Expression
Key Expression
}
type Slice ¶
type Slice struct {
Comments Comments
Pos value.Position
Base Expression
Start Expression
End Expression
}
Click to show internal directories.
Click to hide internal directories.