Skip to content

feat: add HandleEvent function #115

@acouvreur

Description

@acouvreur

The current HandleEventRequest is scoped to events being received from an http request.

func (g *EventHandler) HandleEventRequest(req *http.Request) error {

Would it be possible to add the following function:

// HandleEvent executes registered handlers.
func (g *EventHandler) HandleEvent(deliveryID string, eventName string, event interface{}) error {
	switch event := event.(type) {

	case *github.BranchProtectionRuleEvent:
		return g.BranchProtectionRuleEvent(deliveryID, eventName, event)

	case *github.CheckRunEvent:
   ...
}

This would allow easy extension of the library when events are pushed into a queue and retrieved from something else than an http request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions