Documentation
¶
Overview ¶
Copyright (C) 2023 wwhai
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Index ¶
- Constants
- Variables
- func AllSchema() map[string]typex.DataSchema
- func ExecuteActions(rule *typex.Rule, arg lua.LValue) (lua.LValue, error)
- func ExecuteFailed(vm *lua.LState, arg lua.LValue) (interface{}, error)
- func ExecuteSuccess(vm *lua.LState) (interface{}, error)
- func FilterSingleDataWithSchema(data map[string]interface{}, dataDefine []typex.DataDefine) map[string]interface{}
- func FirstCache(id string, schema typex.DataSchema) typex.DataSchema
- func InitGlobalConfig(path string) typex.RulexConfig
- func InitInternalSchemaCache()
- func NewDeviceTypeManager() typex.DeviceRegistry
- func NewRulexStore(maxSize int) typex.XStore
- func NewSourceTypeManager() typex.SourceRegistry
- func NewTargetTypeManager() typex.TargetRegistry
- func SchemaCount() int
- func SchemaDelete(id string)
- func SchemaFlush()
- func SchemaGet(id string) (typex.DataSchema, bool)
- func SchemaSet(id string, schema typex.DataSchema)
- func SetDebugMode(EnablePProf bool)
- func SetGomaxProcs(GomaxProcs int)
- func StartStore(maxSize int)
- func StartWebDataPipe() error
- func VerifyLuaSyntax(r *typex.Rule) error
- type DeviceTypeManager
- type RulexStore
- type SourceTypeManager
- type TargetTypeManager
- type WebsocketDataPipe
Constants ¶
const ( SUCCESS_KEY string = "Success" FAILED_KEY string = "Failed" ACTIONS_KEY string = "Actions" )
Variables ¶
var GlobalConfig typex.RulexConfig
var GlobalStore typex.XStore
var INIPath string
Functions ¶
func ExecuteActions ¶
* * Execute Lua Callback *
func ExecuteSuccess ¶
LUA Callback : Success
func FilterSingleDataWithSchema ¶ added in v0.6.3
func FilterSingleDataWithSchema(data map[string]interface{}, dataDefine []typex.DataDefine) map[string]interface{}
* * 单线条, data长度为1,其中有一个轴固定为‘date’ ^ | ***** | ** ** | ** ** ** * | ** ** ** ** | ** ** ** ** | ** ** ** ** | ** ** ** ** | ****** ** ** | ******** +------------------------------------------------------------->
func FirstCache ¶ added in v0.6.3
func FirstCache(id string, schema typex.DataSchema) typex.DataSchema
* * 第一次缓冲 *
func NewDeviceTypeManager ¶
func NewDeviceTypeManager() typex.DeviceRegistry
func NewRulexStore ¶
func NewSourceTypeManager ¶
func NewSourceTypeManager() typex.SourceRegistry
func NewTargetTypeManager ¶
func NewTargetTypeManager() typex.TargetRegistry
func StartStore ¶
func StartStore(maxSize int)
Types ¶
type DeviceTypeManager ¶
type DeviceTypeManager struct {
// contains filtered or unexported fields
}
func (*DeviceTypeManager) All ¶
func (rm *DeviceTypeManager) All() []*typex.XConfig
func (*DeviceTypeManager) Find ¶
func (rm *DeviceTypeManager) Find(name typex.DeviceType) *typex.XConfig
func (*DeviceTypeManager) Register ¶
func (rm *DeviceTypeManager) Register(name typex.DeviceType, f *typex.XConfig)
type RulexStore ¶
type RulexStore struct {
// contains filtered or unexported fields
}
func (*RulexStore) Delete ¶
func (rs *RulexStore) Delete(k string) error
func (*RulexStore) FuzzyGet ¶
func (rs *RulexStore) FuzzyGet(k string) string
模糊查询匹配 支持: *AAA AAA* A*B
func (*RulexStore) SetDuration ¶
func (rs *RulexStore) SetDuration(k string, v string, d time.Duration)
* * 设置过期时间 *
type SourceTypeManager ¶
type SourceTypeManager struct {
// contains filtered or unexported fields
}
func (*SourceTypeManager) All ¶
func (rm *SourceTypeManager) All() []*typex.XConfig
type TargetTypeManager ¶
type TargetTypeManager struct {
// contains filtered or unexported fields
}
func (*TargetTypeManager) All ¶
func (rm *TargetTypeManager) All() []*typex.XConfig
func (*TargetTypeManager) Find ¶
func (rm *TargetTypeManager) Find(name typex.TargetType) *typex.XConfig
func (*TargetTypeManager) Register ¶
func (rm *TargetTypeManager) Register(name typex.TargetType, f *typex.XConfig)
type WebsocketDataPipe ¶ added in v0.6.3
type WebsocketDataPipe struct { WsServer websocket.Upgrader Clients map[string]*websocket.Conn // contains filtered or unexported fields }
* * Websocket 管道 *
func InitWebDataPipe ¶ added in v0.6.3
func InitWebDataPipe(rulex typex.RuleX) *WebsocketDataPipe
* * 初始化缓冲器 *