function

package
v0.5.9 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: BSD-3-Clause Imports: 9 Imported by: 16

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 (*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 {
	Value expr.Expr `json:"value"`
}

Jump to

Keyboard shortcuts

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