handler

package
v0.0.0-...-6306fee Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorResponse

func ErrorResponse(err error) (*events.APIGatewayV2HTTPResponse, error)

ErrorResponse builds the API Gateway Lambda response as a structured JSON for a given error. The HTTP status code is inferred from the error type.

func JsonResponse

func JsonResponse(statusCode int, data any) (*events.APIGatewayV2HTTPResponse, error)

JsonResponse builds the API Gateway Lambda response in JSON format.

Types

type BadRequest

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

func NewBadRequest

func NewBadRequest(err string) *BadRequest

func (*BadRequest) StatusCode

func (e *BadRequest) StatusCode() int

type HttpError

type HttpError interface {
	Error() string
	StatusCode() int
}

HttpError is the interface for adding a StatusCode on top of an error.

Jump to

Keyboard shortcuts

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