githubwebhookhandler

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitHubWebhookHandler

type GitHubWebhookHandler interface {
	httphandler.FastHTTPHandler
}

GitHubWebhookHandler defines http handler behaviours.

type Handler

type Handler struct {
	MessageQueue chan *sarama.ProducerMessage
	Logger       *slog.Logger
	Topic        kafkacp.KafkaTopicIdentifier
	Secret       string
}

Handler represents http handler configuration and must satisfy GitHubWebhookHandler interface.

func New

func New(options ...Option) (*Handler, error)

New instantiates new handler instance.

func (Handler) Handle

func (h Handler) Handle(ctx *fasthttp.RequestCtx)

Handle is a fasthttp handler function.

type Option

type Option func(*Handler) error

Option represents option function type.

func WithLogger

func WithLogger(l *slog.Logger) Option

WithLogger sets logger.

func WithProducerGitHubMessageQueue

func WithProducerGitHubMessageQueue(mq chan *sarama.ProducerMessage) Option

WithProducerGitHubMessageQueue sets kafka producer message queue for github webhooks.

func WithTopic

func WithTopic(s kafkacp.KafkaTopicIdentifier) Option

WithTopic sets topic name to consume.

func WithWebhookSecret

func WithWebhookSecret(s string) Option

WithWebhookSecret sets github webhook secret.

Jump to

Keyboard shortcuts

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