function

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2018 License: BSD-3-Clause Imports: 11 Imported by: 14 modules, 16 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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