adapter

package
v0.47.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingGitLabEventHeader      = errors.New("missing X-Gitlab-Event Header")
	ErrEventNotSpecifiedToParse      = errors.New("event not defined to be parsed")
	ErrReadingRequestBody            = errors.New("error reading request body")
	ErrGitLabTokenVerificationFailed = errors.New("token validation failed")
	ErrCouldNotParseWebhookEvent     = errors.New("could parse the webhook event")
	ErrCouldNotHandleEvent           = errors.New("error handling the event")
)

Functions

func NewAdapter

func NewAdapter(ctx context.Context, processed adapter.EnvConfigAccessor, ceClient cloudevents.Client) adapter.Adapter

NewAdapter returns the instance of gitLabReceiveAdapter that implements adapter.Adapter interface

func NewEnvConfig

func NewEnvConfig() adapter.EnvConfigAccessor

NewEnvConfig function reads env variables defined in envConfig structure and returns accessor interface

func NewWebhookHandler added in v0.47.0

func NewWebhookHandler(secret string, sender EventSender) webhook

NewWebhookHandler provide a webhook receiver that parses Gitlab events and emits CloudEvents.

Types

type EventSender added in v0.47.0

type EventSender func(payload interface{}, header http.Header) error

Jump to

Keyboard shortcuts

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