githubingest

package
v0.0.0-...-f44d1fc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 24, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package githubingest defines a framework for processing events from GitHub webhooks

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PubSubProcessor

type PubSubProcessor struct {
	// Topic is The full private feed - events from all repositories (including private ones).
	Topic messagePublisher
	// PublicOnlyTopic is a feed of only events from public repositories.
	PublicOnlyTopic messagePublisher
}

PubSubProcessor publishes pubsub events to the given topic for each processed event.

func (*PubSubProcessor) Process

func (psp *PubSubProcessor) Process(ctx context.Context, ev *event.Event) error

Process runs the pubsub processor for a single event.

type Server

type Server struct {
	Processor processor
}

Server defines a handler for accepting GitHub web hooks and processing them.

func (*Server) Handler

func (s *Server) Handler(w http.ResponseWriter, r *http.Request)

Handler is the main entrypoint for the Github event webhook.

type Topic

type Topic struct {
	*pubsub.Topic
}

Topic is just a small wrapper around pubsub.Topic that collapses the Publish...Get methods into a single call (makes testing easier, too).

func (*Topic) PublishMessage

func (t *Topic) PublishMessage(ctx context.Context, msg *pubsub.Message) error

PublishMessage is a simplified wrapper for pubsub topics - it publishes and just returns the error.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL