response

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrResponseVersionNotSupported = errors.New("gateway[response]: version not supported")
)

Functions

This section is empty.

Types

type APIGatewayResponse added in v0.1.0

type APIGatewayResponse struct {
	StatusCode        int                 `json:"statusCode"`
	Headers           map[string]string   `json:"headers"`
	MultiValueHeaders map[string][]string `json:"multiValueHeaders"`
	Body              string              `json:"body"`
	IsBase64Encoded   bool                `json:"isBase64Encoded,omitempty"`

	// Just for APIGateway v2
	Cookies []string `json:"cookies"`
}

func (APIGatewayResponse) ToV1Map added in v0.1.0

func (agr APIGatewayResponse) ToV1Map() map[string]any

func (APIGatewayResponse) ToV2Map added in v0.1.0

func (agr APIGatewayResponse) ToV2Map() map[string]any

type Writer

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

Writer implements the http.ResponseWriter interface in order to support the API Gateway Lambda HTTP "protocol".

func New

func New() *Writer

New returns a new response writer to capture http output.

func (*Writer) CloseNotify

func (w *Writer) CloseNotify() <-chan bool

CloseNotify notify when the response is closed

func (*Writer) End

func (w *Writer) End() APIGatewayResponse

End the request.

func (*Writer) Header

func (w *Writer) Header() http.Header

Header implementation.

func (*Writer) Write

func (w *Writer) Write(b []byte) (int, error)

Write implementation.

func (*Writer) WriteHeader

func (w *Writer) WriteHeader(status int)

WriteHeader implementation.

Jump to

Keyboard shortcuts

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