add trigger event idea.
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user