githubhandleroptions

package
v0.1.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPHandler

type HTTPHandler struct {
	Webhook       *github.Webhook
	CommonHandler *httphandleroptions.HTTPHandler
	Topic         kafkaconsumer.KafkaTopicIdentifier
}

HTTPHandler represents github http handler functionality.

func New

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

New instantiates new http handler for github webhook.

func (HTTPHandler) ParseRequestHeaders

func (HTTPHandler) ParseRequestHeaders(h http.Header) *RequestHeaders

ParseRequestHeaders parses incoming http headers and sets header values.

type Handler

type Handler interface {
	ParseRequestHeaders(h http.Header) *RequestHeaders
}

Handler defines http handler behaviours.

type Option

type Option func(*HTTPHandler) error

Option represents option function type.

func WithCommonHandler

func WithCommonHandler(h *httphandleroptions.HTTPHandler) Option

WithCommonHandler sets common handler.

func WithTopic

WithTopic sets topic name to consume.

func WithWebhook

func WithWebhook(wh *github.Webhook) Option

WithWebhook sets webhook.

type RequestHeaders

type RequestHeaders struct {
	Event      string
	TargetType string
	DeliveryID uuid.UUID
	HookID     uint64
	TargetID   uint64
}

RequestHeaders represents required http headers for webhook transaction record.

Jump to

Keyboard shortcuts

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