gitlabwebhookhandler

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitLabWebhookHandler

type GitLabWebhookHandler interface {
	httphandler.FastHTTPHandler
}

GitLabWebhookHandler 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 GitLabWebhookHandler 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 WithProducerGitLabMessageQueue

func WithProducerGitLabMessageQueue(mq chan *sarama.ProducerMessage) Option

WithProducerGitLabMessageQueue sets kafka producer message queue for gitlab webhooks.

func WithTopic

func WithTopic(s string) Option

WithTopic sets topic name to consume.

func WithWebhookSecret

func WithWebhookSecret(s string) Option

WithWebhookSecret sets gitlab webhook secret.

Jump to

Keyboard shortcuts

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