Documentation
¶
Index ¶
- type LuaTransform
- type LuaTransformConfiguration
- type RowData
- type Xlsx2JsonTransform
- func (x *Xlsx2JsonTransform) Close() error
- func (x *Xlsx2JsonTransform) Destroy()
- func (x *Xlsx2JsonTransform) Init(ruleConfig types.Config, configuration types.Configuration) error
- func (x *Xlsx2JsonTransform) New() types.Node
- func (x *Xlsx2JsonTransform) OnMsg(ctx types.RuleContext, msg types.RuleMsg)
- func (x *Xlsx2JsonTransform) Type() string
- type Xlsx2JsonTransformConfiguration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LuaTransform ¶
type LuaTransform struct {
Config LuaTransformConfiguration
// contains filtered or unexported fields
}
LuaTransform is a component that transforms messages based on Lua scripts
func (*LuaTransform) Destroy ¶
func (x *LuaTransform) Destroy()
Destroy releases the resources of the component
func (*LuaTransform) Init ¶
func (x *LuaTransform) Init(ruleConfig types.Config, configuration types.Configuration) error
Init initializes the component
func (*LuaTransform) New ¶
func (x *LuaTransform) New() types.Node
New creates a new instance of LuaFilter
func (*LuaTransform) OnMsg ¶
func (x *LuaTransform) OnMsg(ctx types.RuleContext, msg types.RuleMsg)
OnMsg handles the message
func (*LuaTransform) Type ¶
func (x *LuaTransform) Type() string
Type returns the type of the component
type LuaTransformConfiguration ¶
type LuaTransformConfiguration struct {
//Script configures the function body content or the script file path with `.lua` as the suffix
//Only need to provide the function body content, if it is a file path, then need to provide the complete script function:
//function Transform(msg, metadata, msgType) ${Script} \n end
//return msg, metadata, msgType
//The parameter msg, if the data type of msg is JSON, then it will be converted to the Lua table type before calling the function
Script string
}
LuaTransformConfiguration node configuration
type Xlsx2JsonTransform ¶
type Xlsx2JsonTransform struct {
Config Xlsx2JsonTransformConfiguration
}
func (*Xlsx2JsonTransform) Close ¶
func (x *Xlsx2JsonTransform) Close() error
func (*Xlsx2JsonTransform) Init ¶
func (x *Xlsx2JsonTransform) Init(ruleConfig types.Config, configuration types.Configuration) error
Init 组件初始化,一般做一些组件参数配置或者客户端初始化操作 规则链里的规则节点初始化会调用一次
func (*Xlsx2JsonTransform) New ¶
func (x *Xlsx2JsonTransform) New() types.Node
New 创建一个组件新实例 每个规则链的规则节点都会创建一个新的实例,数据是隔离的
func (*Xlsx2JsonTransform) OnMsg ¶
func (x *Xlsx2JsonTransform) OnMsg(ctx types.RuleContext, msg types.RuleMsg)
OnMsg 处理消息,并控制流向子节点的关系。每条流入组件的数据会经过该方法处理 ctx:规则引擎处理消息上下文 msg:消息
func (*Xlsx2JsonTransform) Type ¶
func (x *Xlsx2JsonTransform) Type() string
Type 组件类型,类型不能重复。 用于规则链,node.type配置,初始化对应的组件 建议使用`/`区分命名空间,防止冲突。例如:x/httpClient
type Xlsx2JsonTransformConfiguration ¶
type Xlsx2JsonTransformConfiguration struct {
// 文件下载链接
DownLoadUrl string
}
Xlsx2JsonTransformConfiguration node configuration
Click to show internal directories.
Click to hide internal directories.