You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
424 B

  1. package events
  2. import "fmt"
  3. type ExternalEvent struct {
  4. Kind string
  5. Values map[string]string
  6. }
  7. func (e ExternalEvent) EventDescription() string {
  8. return fmt.Sprintf("External(kind:%s, values:%v)", e.Kind, e.Values)
  9. }
  10. func (e ExternalEvent) TriggerKind() string {
  11. return fmt.Sprintf("External[%s]", e.Kind)
  12. }
  13. func (e ExternalEvent) TriggerValue(key string) (string, bool) {
  14. v, ok := e.Values[key]
  15. return v, ok
  16. }