script

package
Version: v0.0.0-...-e50a933 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2017 License: MIT Imports: 4 Imported by: 2

Documentation

Overview

* * runtime 运行时脚本,需要在调用前传入全局参数 map[string][][]interface{}, * 和结果输出 map[string]interface{},以及当前计算数据位标 i * 该脚本会运行逻辑,并有一定的输出结果会写到 map[string]interface{} 中 * 支持 求和 运算, 正则:${SUM,结果变量名,计算字段 Array[0][i][price],分片字段 Array[0][i][leader]} *

* * string 脚本表示,最后直接输出字符串

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RuntimeScript

type RuntimeScript struct {
	// contains filtered or unexported fields
}

func NewRuntimeScript

func NewRuntimeScript() *RuntimeScript

func (*RuntimeScript) Call

func (s *RuntimeScript) Call() (interface{}, error)

func (*RuntimeScript) Parse

func (s *RuntimeScript) Parse(str string)

func (*RuntimeScript) SetCallArgs

func (s *RuntimeScript) SetCallArgs(args ...interface{})

type Script

type Script interface {
	SetCallArgs(...interface{})
	Parse(str string)
	Call() (interface{}, error)
}

type StringScript

type StringScript struct {
	// contains filtered or unexported fields
}

func NewStringScript

func NewStringScript() *StringScript

func (*StringScript) Call

func (s *StringScript) Call() (interface{}, error)

func (*StringScript) Parse

func (s *StringScript) Parse(str string)

func (*StringScript) SetCallArgs

func (s *StringScript) SetCallArgs(...interface{})

Jump to

Keyboard shortcuts

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