Documentation ¶
Index ¶
- Constants
- Variables
- func Error(err error, msg string) error
- func Errorf(err error, format string, args ...interface{}) error
- func Errors(err ...error) error
- func IsNil(input interface{}) bool
- func IsTypeOf(value Value, check Type) bool
- func NewRootScope() (*Scope, CloseFunc)
- func ParamsFrom(ctx context.Context) (map[string]Value, error)
- func ParamsWith(ctx context.Context, params map[string]Value) context.Context
- func SourceError(src SourceMap, err error) error
- func TypeError(actual Type, expected ...Type) error
- func ValidateArgs(args []Value, minimum, maximum int) error
- func ValidateType(value Value, required ...Type) error
- func ValidateValueTypePairs(pairs ...PairValueType) error
- type Cloneable
- type CloseFunc
- type Expression
- type Function
- type Getter
- type OperatorExpression
- type PairValueType
- type RootScope
- type Scope
- func (s *Scope) Fork() *Scope
- func (s *Scope) GetVariable(name string) (Value, error)
- func (s *Scope) HasVariable(name string) bool
- func (s *Scope) MustGetVariable(name string) Value
- func (s *Scope) SetVariable(name string, val Value) error
- func (s *Scope) UpdateVariable(name string, val Value) error
- type Setter
- type SourceMap
- type Type
- type Value
Constants ¶
View Source
const MaxArgs = 65536
Variables ¶
View Source
var ( ErrMissedArgument = errors.New("missed argument") ErrInvalidArgument = errors.New("invalid argument") ErrInvalidArgumentNumber = errors.New("invalid argument number") ErrInvalidType = errors.New("invalid type") ErrInvalidOperation = errors.New("invalid operation") ErrNotFound = errors.New("not found") ErrNotUnique = errors.New("not unique") ErrTerminated = errors.New("operation is terminated") ErrUnexpected = errors.New("unexpected error") ErrTimeout = errors.New("operation timed out") ErrNotImplemented = errors.New("not implemented") )
Functions ¶
func IsTypeOf ¶
IsTypeOf return true when value's type is equal to check type. Returns false, otherwise.
func NewRootScope ¶
func SourceError ¶
func ValidateArgs ¶
func ValidateType ¶
ValidateType checks the match of value's type and required types.
func ValidateValueTypePairs ¶ added in v0.5.0
func ValidateValueTypePairs(pairs ...PairValueType) error
ValidateValueTypePairs validate pairs of Values and Types. Returns error when type didn't match
Types ¶
type Expression ¶
type Getter ¶ added in v0.6.0
Getter represents an interface of complex types that needs to be used to read values by path. The interface is created to let user-defined types be used in dot notation data access.
type OperatorExpression ¶
type PairValueType ¶ added in v0.5.0
PairValueType is a supporting structure that used in validateValueTypePairs.
type RootScope ¶ added in v0.5.0
type RootScope struct {
// contains filtered or unexported fields
}
func (*RootScope) AddDisposable ¶ added in v0.5.0
type Scope ¶
type Scope struct {
// contains filtered or unexported fields
}
func (*Scope) HasVariable ¶
func (*Scope) MustGetVariable ¶ added in v0.5.0
type Setter ¶ added in v0.6.0
Setter represents an interface of complex types that needs to be used to write values by path. The interface is created to let user-defined types be used in dot notation assignment.
type SourceMap ¶
type SourceMap struct {
// contains filtered or unexported fields
}
func NewSourceMap ¶
Click to show internal directories.
Click to hide internal directories.