split actions/trigggers into seperate files

This commit is contained in:
2023-07-18 09:34:47 +02:00
parent a2ea3209f1
commit a457a313b7
7 changed files with 132 additions and 121 deletions

26
internal/config.go Normal file
View File

@@ -0,0 +1,26 @@
package internal
import "fmt"
type OptionMissingError struct {
OptionName string
}
func (o OptionMissingError) Error() string {
return fmt.Sprintf("Error during config parsing: option %s could not be parsed.", o.OptionName)
}
type Options map[string]interface{}
type ActionConfig struct {
Type string `json:"type"`
Options Options `json:"options"`
Stage int `json:"stage"`
}
type KillSwitchConfig struct {
Name string `json:"name"`
Type string `json:"type"`
Options Options `json:"options"`
Actions []ActionConfig `json:"actions"`
}