interfaces

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: May 7, 2022 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action interface {
	// Execute executes action
	Execute(trigger TriggerEvent) error
}

Action automation condition interface

type Automation

type Automation interface {
	// Execute automation actions
	Execute(trigger TriggerEvent) error
	// AddTrigger Add trigger to automation
	AddTrigger(trigger string)
	// GetTriggers return automation triggers list
	GetTriggers() []string
	// AddAction adds action to automation
	AddAction(action Action)
	// AddCondition set automation condition
	AddCondition(condition Condition)
}

Automation automation interface

type Condition

type Condition interface {
	// Check checks condition
	Check(trigger TriggerEvent) (bool, error)
}

Condition automation condition interface

type TriggerEvent

type TriggerEvent interface {
	// GetName returns trigger event name
	GetName() string
	// GetData returns trigger event data
	GetData() map[string]string
	// GetFromMeta return value from trigger event metadata by key
	GetFromMeta(key string) string
}

TriggerEvent interface for automation trigger events

Jump to

Keyboard shortcuts

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