Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action struct {
Name string `json:"name"`
Trigger string `json:"trigger"`
If iff.If `json:"if"`
Then []then.Then `json:"then"`
Log *zap.SugaredLogger `json:"-"`
// contains filtered or unexported fields
}
Action represents an action to be executed based on some conditions
type ActionConfig ¶
ActionConfig manages the configuration of actions
func DefaultConfig ¶
func DefaultConfig() *ActionConfig
DefaultConfig returns the default action configuration
func NewActionConfig ¶
func NewActionConfig(dir string) (*ActionConfig, *nerr.E)
NewActionConfig creates a new action manager and starts it
func (*ActionConfig) ActionsByTrigger ¶
func (c *ActionConfig) ActionsByTrigger(ctx echo.Context) error
ActionsByTrigger .
func (*ActionConfig) GetActionsByTrigger ¶
func (c *ActionConfig) GetActionsByTrigger(trigger string) []*Action
GetActionsByTrigger returns all actions with the specified trigger
type ActionManager ¶
type ActionManager struct {
Config *ActionConfig
Workers int
EventStream chan events.Event
EventCache string
// contains filtered or unexported fields
}
An ActionManager manages executing a set of actions
func (*ActionManager) ManageAction ¶
func (a *ActionManager) ManageAction(action *Action) *nerr.E
ManageAction adds an action to be managed by the action manager currently, an action manager only manages interval and event trigger actions
type ActionRequest ¶
ActionRequest is submitted to the action manager to run an action on one of it's worker threads
Click to show internal directories.
Click to hide internal directories.