automation

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2022 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const ActionFunc = "automationAction"

ActionFunc ...

View Source
const ConditionFunc = "automationCondition"

ConditionFunc ...

View Source
const TriggerFunc = "automationTrigger"

TriggerFunc ...

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Action ...

func NewAction

func NewAction(scriptService scripts.ScriptService,
	entityManager entity_manager.EntityManager,
	model *m.Action) (action *Action, err error)

NewAction ...

func (*Action) Run

func (a *Action) Run(entityId *common.EntityId) (result string, err error)

Run ...

type ActionBind

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

Javascript Binding

Action

.callAction(entityId, action, args)

func NewActionBind

func NewActionBind(action *Action) *ActionBind

NewActionBind...

func (*ActionBind) CallAction

func (e *ActionBind) CallAction(id common.EntityId, action string, arg map[string]interface{})

CallAction ...

type Automation

type Automation interface {
	Start() (err error)
	Shutdown() (err error)
	Reload()
	AddTask(model *m.Task)
	RemoveTask(model *m.Task)
}

Automation ...

func NewAutomation

func NewAutomation(lc fx.Lifecycle,
	eventBus event_bus.EventBus,
	scriptService scripts.ScriptService,
	entityManager entity_manager.EntityManager,
	adaptors *adaptors.Adaptors,
	pluginManager common.PluginManager) (auto Automation)

NewAutomation ...

type Condition

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

Condition ...

func NewCondition

func NewCondition(scriptService scripts.ScriptService,
	model *m.Condition,
	entityManager entity_manager.EntityManager) (condition *Condition, err error)

NewCondition ...

func (*Condition) Check

func (r *Condition) Check(ctx context.Context) (result string, err error)

Check ...

func (*Condition) Status

func (r *Condition) Status() bool

Status ...

type ConditionBind

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

ConditionBind...

func NewConditionBind

func NewConditionBind(condition *Condition) *ConditionBind

Javascript Binding

Condition

type ConditionGroup

type ConditionGroup struct {
	sync.Mutex
	// contains filtered or unexported fields
}

ConditionGroup ...

func NewConditionGroup

func NewConditionGroup(automation *automation,
	t common.ConditionType) *ConditionGroup

NewConditionGroup ...

func (*ConditionGroup) AddCondition

func (c *ConditionGroup) AddCondition(condition *Condition)

AddCondition ...

func (*ConditionGroup) Check

func (c *ConditionGroup) Check(entityId *common.EntityId) (state bool, err error)

Check ...

type Task

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

Task ...

func NewTask

func NewTask(automation *automation,
	scriptService scripts.ScriptService,
	model *m.Task,
	entityManager entity_manager.EntityManager,
	rawPlugin triggers.IGetTrigger) *Task

NewTask ...

func (*Task) CallAction added in v0.5.3

func (t *Task) CallAction(name string)

CallAction ...

func (*Task) CallTrigger added in v0.5.3

func (t *Task) CallTrigger(name string)

CallTrigger ...

func (*Task) Id

func (t *Task) Id() int64

Id ...

func (*Task) Name

func (t *Task) Name() string

Name ...

func (*Task) Start

func (t *Task) Start()

Start ...

func (*Task) Stop

func (t *Task) Stop()

Stop ...

type Trigger

type Trigger struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Trigger ...

func NewTrigger

func NewTrigger(scriptService scripts.ScriptService,
	model *m.Trigger,
	triggerPlugin triggers.ITrigger) (tr *Trigger, err error)

NewTrigger ...

func (*Trigger) Call added in v0.5.3

func (tr *Trigger) Call()

Call ...

func (*Trigger) Check

func (tr *Trigger) Check(msg interface{}) (state bool, err error)

Check ...

func (*Trigger) EntityId

func (tr *Trigger) EntityId() *common.EntityId

EntityId ...

func (*Trigger) Id

func (tr *Trigger) Id() int64

Id ...

func (*Trigger) Start

func (tr *Trigger) Start() (err error)

Start ...

func (*Trigger) Stop

func (tr *Trigger) Stop() (err error)

Stop ...

type TriggerBind

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

Javascript Binding

Trigger

func NewTriggerBind

func NewTriggerBind(tr *Trigger) *TriggerBind

NewTriggerBind...

Jump to

Keyboard shortcuts

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