handler

package
v0.0.0-...-b082d5a Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Overview

Package handler provides a generic interface for processing requests using a list of processors.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler is the main handler for the promotion app.

func NewPromotionHandler

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

NewPromotionHandler creates a new promotion handler instance.

func (*Handler) GetLambdaPayloadType

func (h *Handler) GetLambdaPayloadType() string

GetLambdaPayloadType returns the lambda payload type.

func (*Handler) Process

func (h *Handler) Process(body []byte, headers map[string]string) (*promotion.Bus, error)

Process processes the incoming request.

func (*Handler) ProcessEvent

func (h *Handler) ProcessEvent(event map[string]any) (*promotion.Bus, error)

ProcessEvent processes the incoming EventBridge event.

type Option

type Option func(*Handler)

Option is a functional option for the handler.

func WithAuthMode

func WithAuthMode(authMode string) Option

WithAuthMode sets the authentication mode for the handler. It is applied as a functional option during initialization.

func WithContext

func WithContext(ctx context.Context) Option

WithContext sets the context for the handler.

func WithLambdaPayloadType

func WithLambdaPayloadType(payloadType string) Option

WithLambdaPayloadType sets the lambda payload type for a Handler instance.

func WithLogger

func WithLogger(logger *slog.Logger) Option

WithLogger sets the logger instance for the handler.

func WithSSMKey

func WithSSMKey(key string) Option

WithSSMKey sets the SSM key for retrieving credentials and adds it as an option to the handler configuration.

func WithToken

func WithToken(token string) Option

WithToken sets the GitHub token used for authentication in the handler.

func WithWebhookSecret

func WithWebhookSecret(secret string) Option

WithWebhookSecret configures the handler with a webhook secret for request validation.

Directories

Path Synopsis
Package processor provides a generic interface for processing requests using a list of processors.
Package processor provides a generic interface for processing requests using a list of processors.

Jump to

Keyboard shortcuts

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