function

package
Version: v0.5.4 Latest Latest
Warning

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

Go to latest
Published: May 18, 2018 License: BSD-3-Clause Imports: 11 Imported by: 21

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToRef

func ConvertToRef(val interface{}) (*ref.MappingRef, error)

func ConvertToValue

func ConvertToValue(value interface{}, dataType funcexprtype.Type) (interface{}, error)

func HandleToSingleOutput

func HandleToSingleOutput(values interface{}) interface{}

func ListAllFunctions

func ListAllFunctions() []string

func Registry

func Registry(f Function)

Types

type Func

type Func interface {
	Eval(inputScope, outputScope data.Scope) ([]interface{}, error)
	String() string
}

type Function

type Function interface {
	GetName() string
	GetCategory() string
}

func GetFunction

func GetFunction(name string) (Function, error)

func GetFunctionByTag

func GetFunctionByTag(name string, tag string) (Function, error)

type FunctionExp

type FunctionExp struct {
	Name   string       `json:"name"`
	Params []*Parameter `json:"params"`
}

func ConvertToFunction

func ConvertToFunction(val interface{}) (*FunctionExp, error)

func (*FunctionExp) Eval

func (f *FunctionExp) Eval() (interface{}, error)

func (*FunctionExp) EvalWithData

func (f *FunctionExp) EvalWithData(data interface{}, inputScope data.Scope, resolver data.Resolver) (interface{}, error)

func (*FunctionExp) EvalWithScope

func (f *FunctionExp) EvalWithScope(inputScope data.Scope, resolver data.Resolver) (interface{}, error)

type Parameter

type Parameter struct {
	Function *FunctionExp      `json:"function"`
	Type     funcexprtype.Type `json:"type"`
	Value    interface{}       `json:"value"`
}

func (*Parameter) IsEmtpy

func (p *Parameter) IsEmtpy() bool

func (*Parameter) IsFunction

func (p *Parameter) IsFunction() bool

func (*Parameter) UnmarshalJSON

func (p *Parameter) UnmarshalJSON(paramData []byte) error

Jump to

Keyboard shortcuts

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