interpreters

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conf

type Conf struct {
	Type       string                 `json:"type" desc:"enum: tengo" validate:"required"`
	Script     string                 `json:"script" validate:"required"`
	InitVarMap map[string]interface{} `json:"int_var_map" desc:"init variables in script" validate:"-"`
	RtVarName  string                 `json:"rt_var_name" desc:"returned variable name" validate:"-"`
}

func (Conf) Build

func (c Conf) Build() (pipeline.Handler, error)

type Tengo

type Tengo struct {
	Conf
	// contains filtered or unexported fields
}

func NewTengo

func NewTengo(conf Conf) (*Tengo, error)

func (*Tengo) Handle

func (tengo *Tengo) Handle(ctx context.Context, reqRes *pipeline.HandleRes) (respRes *pipeline.HandleRes, err error)

Jump to

Keyboard shortcuts

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