Documentation ¶
Index ¶
Constants ¶
View Source
const ( // StateChangeName ... StateChangeName = "state_change" // StateChangeFunctionName ... StateChangeFunctionName = "automationTriggerStateChanged" )
View Source
const ( // TopicSystem ... TopicSystem = "system/#" // SystemName ... SystemName = "system" // SystemFunctionName ... SystemFunctionName = "automationTriggerSystem" )
View Source
const ( // TimeName ... TimeName = "time" // TimeFunctionName ... TimeFunctionName = "automationTriggerTime" // TimeQueueSize ... TimeQueueSize = 10 )
View Source
const ( // Name ... Name = "triggers" // TopicSystemStart ... TopicSystemStart = "system/event/start" //todo move // TopicSystemStop ... TopicSystemStop = "system/event/stop" //todo move Version = "0.0.1" )
View Source
const (
// CronOptionTrigger ...
CronOptionTrigger = "cron"
)
Variables ¶
View Source
var F embed.FS
Functions ¶
Types ¶
type IGetTrigger ¶
IGetTrigger ...
type IRegistrar ¶
type IRegistrar interface { RegisterTrigger(ITrigger) error UnregisterTrigger(string) error TriggerList() []string }
IRegistrar ...
type ITrigger ¶
type ITrigger interface { Name() string AsyncAttach(wg *sync.WaitGroup) Subscribe(Subscriber) error Unsubscribe(Subscriber) error FunctionName() string }
todo deAttach
func NewStateChangedTrigger ¶
NewStateChangedTrigger ...
type StateChangeTrigger ¶
type StateChangeTrigger struct {
// contains filtered or unexported fields
}
StateChangeTrigger ...
func (*StateChangeTrigger) AsyncAttach ¶
func (t *StateChangeTrigger) AsyncAttach(wg *sync.WaitGroup)
AsyncAttach ...
func (*StateChangeTrigger) FunctionName ¶
func (b *StateChangeTrigger) FunctionName() string
FunctionName ...
func (*StateChangeTrigger) Subscribe ¶
func (t *StateChangeTrigger) Subscribe(options Subscriber) error
Subscribe ...
func (*StateChangeTrigger) Unsubscribe ¶
func (t *StateChangeTrigger) Unsubscribe(options Subscriber) error
Unsubscribe ...
type Subscriber ¶
type Subscriber struct { EntityId *common.EntityId Handler interface{} Payload m.Attributes }
Subscriber ...
type SystemTrigger ¶
type SystemTrigger struct {
// contains filtered or unexported fields
}
SystemTrigger ...
func (*SystemTrigger) AsyncAttach ¶
func (t *SystemTrigger) AsyncAttach(wg *sync.WaitGroup)
AsyncAttach ...
func (*SystemTrigger) Subscribe ¶
func (t *SystemTrigger) Subscribe(options Subscriber) error
Subscribe ...
func (*SystemTrigger) Unsubscribe ¶
func (t *SystemTrigger) Unsubscribe(options Subscriber) error
Unsubscribe ...
type SystemTriggerMessage ¶ added in v0.14.0
type TimeTrigger ¶
TimeTrigger ...
func (*TimeTrigger) AsyncAttach ¶
func (t *TimeTrigger) AsyncAttach(wg *sync.WaitGroup)
AsyncAttach ...
func (*TimeTrigger) Subscribe ¶
func (t *TimeTrigger) Subscribe(options Subscriber) error
Subscribe ...
func (*TimeTrigger) Unsubscribe ¶
func (t *TimeTrigger) Unsubscribe(options Subscriber) error
Unsubscribe ...
Click to show internal directories.
Click to hide internal directories.