add trigger event idea.

This commit is contained in:
2022-08-18 12:58:47 +02:00
parent b6262007c0
commit c6da62d0c1
3 changed files with 40 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
package events
import "fmt"
type ExternalEvent struct {
Kind string
Values map[string]string
}
func (e ExternalEvent) EventDescription() string {
return fmt.Sprintf("External(kind:%s, values:%v)", e.Kind, e.Values)
}
func (e ExternalEvent) TriggerKind() string {
return fmt.Sprintf("external.%s", e.Kind)
}
func (e ExternalEvent) TriggerValue(key string) (string, bool) {
v, ok := e.Values[key]
return v, ok
}