Documentation ¶
Index ¶
- Constants
- func NewCron() (cron *cr.Cron)
- type Action
- type ActionBind
- type ActionPrototypes
- type Core
- func (b *Core) AddFlow(flow *m.Flow) (err error)
- func (b *Core) AddNode(node *m.Node) (n *Node, err error)
- func (b *Core) AddWorkflow(workflow *m.Workflow) (err error)
- func (b *Core) ConnectNode(node *m.Node) (err error)
- func (b *Core) DeleteWorkflow(workflow *m.Workflow) (err error)
- func (b *Core) DisconnectNode(node *m.Node) (err error)
- func (b *Core) DoWorker(model *m.Worker) (err error)
- func (b *Core) GetFlow(id int64) (*Flow, error)
- func (b *Core) GetNodeById(nodeId int64) *Node
- func (b *Core) GetNodes() (nodes map[int64]*Node)
- func (wf *Core) GetWorkflow(workflowId int64) (workflow *Workflow, err error)
- func (b *Core) InitWorkflows() (err error)
- func (b *Core) ReloadNode(node *m.Node) (err error)
- func (b *Core) RemoveFlow(flow *m.Flow) (err error)
- func (b *Core) RemoveNode(node *m.Node) (err error)
- func (b *Core) RemoveWorker(_worker *m.Worker) (err error)
- func (b *Core) Restart() (err error)
- func (c *Core) Run() (err error)
- func (b *Core) Shutdown()
- func (b *Core) Stop() (err error)
- func (b *Core) UpdateFlow(flow *m.Flow) (err error)
- func (b *Core) UpdateFlowFromDevice(device *m.Device) (err error)
- func (b *Core) UpdateWorker(_worker *m.Worker) (err error)
- func (b *Core) UpdateWorkflow(workflow *m.Workflow) (err error)
- func (b *Core) UpdateWorkflowScenario(workflow *m.Workflow) (err error)
- type Device
- type DeviceBind
- func (d *DeviceBind) GetDescription() string
- func (d *DeviceBind) GetModel() *m.Device
- func (d *DeviceBind) GetName() string
- func (d *DeviceBind) ModBus(f string, address, count uint16, command []uint16) (result *DevModBusResponse)
- func (d *DeviceBind) RunCommand(name string, args []string) (result *DevCommandResponse)
- func (d *DeviceBind) SmartBus(command []byte) (result *DevSmartBusResponse)
- type Flow
- func (f *Flow) AddWorker(model *m.Worker) (err error)
- func (f *Flow) InitWorkers() (err error)
- func (f *Flow) NewMessage(ctx context.Context) (err error)
- func (f *Flow) NewScript(s ...*m.Script) (engine *scripts.Engine, err error)
- func (f *Flow) Remove()
- func (f *Flow) RemoveWorker(worker *m.Worker) (err error)
- func (f *Flow) UpdateWorker(worker *m.Worker) (err error)
- type FlowBind
- type FlowElement
- type FlowLink
- type Gateway
- type IGetMap
- type Map
- func (b *Map) GetAllElements() (elements []*MapElement)
- func (b *Map) GetDevicesStates() (states map[int64]*m.DashboardDeviceState)
- func (b *Map) GetElement(device *m.Device, elementName string) (element *MapElement)
- func (b *Map) GetElements(device *m.Device) (elements []*MapElement)
- func (b *Map) NewMapElement(device *m.Device, elementName string, state *m.DeviceState) *MapElement
- func (b *Map) SetElementState(device *m.Device, elementName, systemName string)
- type MapBind
- type MapElement
- type MapElementBind
- type Message
- type MessageEmitter
- type MessageHandler
- type Node
- type NodeBind
- type NodeMessage
- type NodeResponse
- type NodeStatModel
- type NodeStatus
- type Nodes
- type Status
- type Storage
- type Task
- type Worker
- type Workflow
- func (wf *Workflow) AddFlow(flow *m.Flow) (err error)
- func (wf *Workflow) GetFLow(flowId int64) (flow *Flow, err error)
- func (wf *Workflow) NewScript(model *m.Script) (engine *scripts.Engine, err error)
- func (wf *Workflow) RemoveFlow(flow *m.Flow) (err error)
- func (wf *Workflow) Restart() (err error)
- func (wf *Workflow) Run() (err error)
- func (wf *Workflow) SetScenario(systemName string) (err error)
- func (wf *Workflow) Stop() (err error)
- func (wf *Workflow) UpdateFlow(flow *m.Flow) (err error)
- func (wf *Workflow) UpdateScenario() (err error)
- type WorkflowBind
- func (w *WorkflowBind) GetDescription() string
- func (w *WorkflowBind) GetName() string
- func (w *WorkflowBind) GetScenario() string
- func (w *WorkflowBind) GetScenarioName() string
- func (w *WorkflowBind) GetVar(key string) interface{}
- func (w *WorkflowBind) SetScenario(system_name string)
- func (w *WorkflowBind) SetVar(key string, value interface{})
Constants ¶
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Action ¶
type Action struct { Device *m.Device Node *Node ScriptEngine *scripts.Engine Message *Message // contains filtered or unexported fields }
type ActionBind ¶
type ActionBind struct {
// contains filtered or unexported fields
}
Javascript Binding
IC.Action()
.device() .node()
func (*ActionBind) Device ¶
func (a *ActionBind) Device() *DeviceBind
func (*ActionBind) Node ¶
func (a *ActionBind) Node() *NodeBind
type ActionPrototypes ¶
type Core ¶
func NewCore ¶
func NewCore(adaptors *adaptors.Adaptors, scripts *scripts.ScriptService, graceful *graceful_service.GracefulService, cron *cr.Cron, mqtt *mqtt.Mqtt, telemetry telemetry.ITelemetry, streamService *stream.StreamService) (core *Core, err error)
func (*Core) AddWorkflow ¶
добавление рабочего процесс
func (*Core) DeleteWorkflow ¶
нельзя удалить workflow, если присутствуют связанные сущности
func (*Core) GetNodeById ¶
func (*Core) GetWorkflow ¶
func (*Core) InitWorkflows ¶
инициализация всего рабочего процесса, с запуском дочерни подпроцессов
func (*Core) UpdateFlowFromDevice ¶
type Device ¶
type Device struct {
// contains filtered or unexported fields
}
func (*Device) RunCommand ¶
run command
type DeviceBind ¶
type DeviceBind struct {
// contains filtered or unexported fields
}
Javascript Binding
Device
.getName() .getModel() .getDescription() .runCommand(command []string) .smartBus(command []byte) .modBus(func string, address, count int64, command []byte)
func (*DeviceBind) GetDescription ¶
func (d *DeviceBind) GetDescription() string
func (*DeviceBind) GetModel ¶
func (d *DeviceBind) GetModel() *m.Device
func (*DeviceBind) GetName ¶
func (d *DeviceBind) GetName() string
func (*DeviceBind) ModBus ¶
func (d *DeviceBind) ModBus(f string, address, count uint16, command []uint16) (result *DevModBusResponse)
func (*DeviceBind) RunCommand ¶
func (d *DeviceBind) RunCommand(name string, args []string) (result *DevCommandResponse)
func (*DeviceBind) SmartBus ¶
func (d *DeviceBind) SmartBus(command []byte) (result *DevSmartBusResponse)
type Flow ¶
type Flow struct { Storage Model *m.Flow Connections []*m.Connection FlowElements []*FlowElement Node *Node Workers map[int64]*Worker sync.Mutex // contains filtered or unexported fields }
func (*Flow) InitWorkers ¶
type FlowBind ¶
type FlowBind struct {
// contains filtered or unexported fields
}
Javascript Binding
IC.Flow()
.getName() .getDescription() .setVar(string, interface) .getVar(string) .node()
func (*FlowBind) GetDescription ¶
type FlowElement ¶
type FlowElement struct { Model *m.FlowElement Flow *Flow Workflow *Workflow ScriptEngine *scripts.Engine Prototype ActionPrototypes Action *Action // contains filtered or unexported fields }
func NewFlowElement ¶
func NewFlowElement(model *m.FlowElement, flow *Flow, workflow *Workflow, adaptors *adaptors.Adaptors) (flowElement *FlowElement, err error)
func (*FlowElement) After ¶
func (m *FlowElement) After(message *Message) error
func (*FlowElement) Before ¶
func (m *FlowElement) Before(message *Message) error
func (*FlowElement) GetStatus ¶
func (m *FlowElement) GetStatus() (status Status)
type Map ¶
type Map struct {
// contains filtered or unexported fields
}
func (*Map) GetAllElements ¶
func (b *Map) GetAllElements() (elements []*MapElement)
func (*Map) GetDevicesStates ¶
func (b *Map) GetDevicesStates() (states map[int64]*m.DashboardDeviceState)
func (*Map) GetElement ¶
func (b *Map) GetElement(device *m.Device, elementName string) (element *MapElement)
func (*Map) GetElements ¶
func (b *Map) GetElements(device *m.Device) (elements []*MapElement)
func (*Map) NewMapElement ¶
func (b *Map) NewMapElement(device *m.Device, elementName string, state *m.DeviceState) *MapElement
type MapBind ¶
type MapBind struct {
Map *Map
}
Javascript Binding
map
.setElementState(device, elementName, newState) .getElement(device, elementName) -> MapElementBind .getElements(device) -> []MapElementBind
func (*MapBind) GetElement ¶
func (e *MapBind) GetElement(device *DeviceBind, elementName string) (element *MapElementBind)
func (*MapBind) GetElements ¶
func (e *MapBind) GetElements(device *DeviceBind) (elements []*MapElementBind)
type MapElement ¶
type MapElement struct { Map *Map Options interface{} Device *m.Device State *m.DeviceState ElementName string }
func (*MapElement) GetOptions ¶
func (e *MapElement) GetOptions() interface{}
func (*MapElement) GetState ¶
func (e *MapElement) GetState() interface{}
func (*MapElement) SetOptions ¶
func (e *MapElement) SetOptions(options interface{})
func (*MapElement) SetState ¶
func (e *MapElement) SetState(systemName string)
type MapElementBind ¶
type MapElementBind struct {
// contains filtered or unexported fields
}
Javascript Binding
mapElement
.setState(name) .getState() .setOptions(options) .getOptions()
func (*MapElementBind) GetOptions ¶
func (e *MapElementBind) GetOptions() interface{}
func (*MapElementBind) GetState ¶
func (e *MapElementBind) GetState() interface{}
func (*MapElementBind) SetOptions ¶
func (e *MapElementBind) SetOptions(options interface{})
func (*MapElementBind) SetState ¶
func (e *MapElementBind) SetState(name string)
type Message ¶
func NewMessage ¶
func NewMessage() (m *Message)
type MessageEmitter ¶
type MessageEmitter struct{}
ActionPrototypes
func (*MessageEmitter) After ¶
func (m *MessageEmitter) After(message *Message, flow *Flow) (err error)
func (*MessageEmitter) Before ¶
func (m *MessageEmitter) Before(message *Message, flow *Flow) (err error)
func (*MessageEmitter) Type ¶
func (m *MessageEmitter) Type() string
type MessageHandler ¶
type MessageHandler struct{}
ActionPrototypes
func (*MessageHandler) After ¶
func (m *MessageHandler) After(message *Message, flow *Flow) (err error)
func (*MessageHandler) Before ¶
func (m *MessageHandler) Before(message *Message, flow *Flow) (err error)
func (*MessageHandler) Type ¶
func (m *MessageHandler) Type() string
type NodeBind ¶
type NodeBind struct {
// contains filtered or unexported fields
}
Javascript Binding
node
.name() .status() .stat() .description() .isConnected()
func (*NodeBind) Description ¶
func (*NodeBind) IsConnected ¶
func (*NodeBind) Stat ¶
func (n *NodeBind) Stat() *NodeStatModel
type NodeMessage ¶
type NodeMessage struct { DeviceId int64 `json:"device_id"` DeviceType common.DeviceType `json:"device_type"` Properties json.RawMessage `json:"properties"` Command json.RawMessage `json:"command"` }
type NodeResponse ¶
type NodeResponse struct { DeviceId int64 `json:"device_id"` DeviceType common.DeviceType `json:"device_type"` Properties json.RawMessage `json:"properties"` Response json.RawMessage `json:"response"` Status string `json:"status"` Time float64 `json:"time"` }
type NodeStatModel ¶
type NodeStatus ¶
type NodeStatus string
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
func NewStorage ¶ added in v0.0.17
func NewStorage() Storage
type Worker ¶
type Worker struct { Model *m.Worker CronTask *cr.Task sync.Mutex // contains filtered or unexported fields }
type Workflow ¶
type Workflow struct { Storage sync.Mutex Flows map[int64]*Flow // contains filtered or unexported fields }
func NewWorkflow ¶
func (*Workflow) SetScenario ¶
func (*Workflow) UpdateScenario ¶
type WorkflowBind ¶
type WorkflowBind struct {
// contains filtered or unexported fields
}
Javascript Binding
IC.Workflow()
.getName() .getDescription() .setVar(string, interface) .getVar(string) .getScenario() string .getScenarioName() string .setScenario(string)
func (*WorkflowBind) GetDescription ¶
func (w *WorkflowBind) GetDescription() string
func (*WorkflowBind) GetName ¶
func (w *WorkflowBind) GetName() string
func (*WorkflowBind) GetScenario ¶
func (w *WorkflowBind) GetScenario() string
func (*WorkflowBind) GetScenarioName ¶
func (w *WorkflowBind) GetScenarioName() string
func (*WorkflowBind) GetVar ¶
func (w *WorkflowBind) GetVar(key string) interface{}
func (*WorkflowBind) SetScenario ¶
func (w *WorkflowBind) SetScenario(system_name string)
func (*WorkflowBind) SetVar ¶
func (w *WorkflowBind) SetVar(key string, value interface{})
Source Files ¶
- action.go
- action_bind.go
- core.go
- cron.go
- device.go
- device_bind.go
- flow.go
- flow_bind.go
- flow_element.go
- flow_link.go
- gateway.go
- map.go
- map_bind.go
- map_element.go
- map_element_bind.go
- message.go
- message_emitter.go
- message_handler.go
- models.go
- node.go
- node_bind.go
- prototypes.go
- status.go
- storage.go
- task.go
- worker.go
- workflow.go
- workflow_bind.go
Click to show internal directories.
Click to hide internal directories.