lambdaadapter

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package lambdaadapter serves a standard http.Handler behind a Lambda Function URL in BUFFERED invoke mode (PRD 9.2). The official lambdaurl package supports only RESPONSE_STREAM, and R3 was verified buffered, so this ~100-line adapter keeps the design and avoids a third-party proxy.

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 converts a Function URL event into an http.Request, runs next, and converts the recorded response back into a Function URL response.

func New

func New(next http.Handler) *Handler

New wraps next.

func (*Handler) Invoke

Invoke is the Lambda handler signature for Function URL events.

type Mux added in v0.4.0

type Mux struct {
	HTTP  *Handler
	Tasks map[string]TaskFunc
}

Mux dispatches raw Lambda payloads: task invocations to their TaskFunc, everything else to the buffered Function URL adapter. Function URL events never carry a top-level "task" key, so the probe is unambiguous.

func (*Mux) Invoke added in v0.4.0

func (m *Mux) Invoke(ctx context.Context, raw json.RawMessage) (any, error)

Invoke is the Lambda handler entry point.

type TaskFunc added in v0.4.0

type TaskFunc func(ctx context.Context) error

TaskFunc runs one background job invoked directly by the scheduler (payload {"task":"<name>"}), outside the Function URL path (M4b-1).

Jump to

Keyboard shortcuts

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