scripts

package
v0.1.72 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2019 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	Agent *agents.AgentConfig // Agent
	App   *agents.AppConfig   // App
	Item  *agents.Item        // Item

	TimeType string              // 时间类型
	TimePast teaconfigs.TimePast // 过去时间
	TimeUnit teaconfigs.TimeUnit // 时间单位,用于分隔X轴
	DayFrom  string              // 开始日期
	DayTo    string              // 结束日期
}

脚本执行的上下文

type Engine

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

脚本引擎

func NewEngine

func NewEngine() *Engine

获取新引擎

func (*Engine) AddOutput added in v0.1.7

func (this *Engine) AddOutput(output string)

添加Output

func (*Engine) Charts

func (this *Engine) Charts() []maps.Map

获取Widget中的图表对象

func (*Engine) Context added in v0.1.7

func (this *Engine) Context() *Context

获取Context

func (*Engine) Exporting added in v0.1.7

func (this *Engine) Exporting()

设置是否导出数值

func (*Engine) Output

func (this *Engine) Output() []string

获取控制台输出

func (*Engine) Result added in v0.1.7

func (this *Engine) Result() interface{}

获取导出的的内容

func (*Engine) RunCode

func (this *Engine) RunCode(code string) error

运行Widget代码

func (*Engine) SetCache added in v0.1.7

func (this *Engine) SetCache(cache bool)

设置是否开启缓存

func (*Engine) SetContext

func (this *Engine) SetContext(context *Context)

设置上下文信息

func (*Engine) SetDBEnabled added in v0.1.7

func (this *Engine) SetDBEnabled(b bool)

设置数据库是否可用

Jump to

Keyboard shortcuts

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