velodrome/transform/plugins/events.go
func NewEventMatcher(eventDescription string) EventMatcher {
	split := strings.SplitN(eventDescription, ":", 2)
	switch split[0] {
	case "":
		return FalseEvent{}
	case "commented":
		return CommentEvent{}
	case "opened":
		return OpenEvent{}
	case "reopened":
		return ReopenEvent{}
	case "merged":
		return MergeEvent{}
	case "closed":
		return CloseEvent{}
	case "labeled":
		if len(split) != 2 {
			panic(fmt.Errorf("Missing label part of the event"))
		}
		return LabelEvent{split[1]}
	case "unlabeled":
		if len(split) != 2 {
			panic(fmt.Errorf("Missing label part of the event"))
		}
		return UnlabelEvent{split[1]}
	default:
		panic(fmt.Errorf("Unknown type of event: %s", split[0]))
	}
}
func NewEventMatcher(eventDescription string) EventMatcher {
	split := strings.SplitN(eventDescription, ":", 2)
	switch split[0] {
	case "":
		return FalseEvent{}
	case "commented":
		return CommentEvent{}
	case "opened":
		return OpenEvent{}
	case "reopened":
		return ReopenEvent{}
	case "merged":
		return MergeEvent{}
	case "closed":
		return CloseEvent{}
	case "labeled":
		if len(split) != 2 {
			panic(fmt.Errorf("Missing label part of the event"))
		}
		return LabelEvent{split[1]}
	case "unlabeled":
		if len(split) != 2 {
			panic(fmt.Errorf("Missing label part of the event"))
		}
		return UnlabelEvent{split[1]}
	default:
		panic(fmt.Errorf("Unknown type of event: %s", split[0]))
	}
}
// NewEventMatcher returns the correct EventMatcher based on description
// Incoming event should have the following form:
// eventName:labelName. If eventName is not label, then the second part
// can be omitted.