script_handler

package
v0.19.3 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name = "script_handler"
)

Variables

This section is empty.

Functions

func Create

func Create(id, name string, conf *Config, workers map[eosc.RequireId]eosc.IWorker) (eosc.IWorker, error)

初始化插件执行实例

func NewFactory

func NewFactory() eosc.IExtenderDriverFactory

func Register

func Register(register eosc.IExtenderDriverRegister)

Types

type Config

type Config struct {
	Script  string `json:"script" label:"调用的脚本"`
	Package string `json:"package" label:"调用的包名"`
	Fname   string `json:"fname" label:"调用函数名,需定义时返回error"`
	Stage   string `json:"stage" label:"脚本执行阶段,request或response,默认request"`
}

参数配置属性

type Script

type Script struct {
	drivers.WorkerBase
	// contains filtered or unexported fields
}

func (*Script) CheckSkill

func (a *Script) CheckSkill(skill string) bool

func (*Script) Destroy

func (a *Script) Destroy()

func (*Script) DoFilter

func (a *Script) DoFilter(ctx eocontext.EoContext, next eocontext.IChain) (err error)

拦截请求过滤,内部转换为http类型再处理

func (*Script) DoHttpFilter

func (a *Script) DoHttpFilter(ctx http_service.IHttpContext, next eocontext.IChain) error

DoHttpFilter 核心http处理方法

func (*Script) Reset

func (a *Script) Reset(conf interface{}, workers map[eosc.RequireId]eosc.IWorker) error

插件被修改时执行

func (*Script) Start

func (a *Script) Start() error

插件添加时执行

func (*Script) Stop

func (a *Script) Stop() error

插件删除时间执行

Jump to

Keyboard shortcuts

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