lambdaurl

package
v0.1.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 10 Imported by: 0

README

Lambda Function URL adapter

adapters/lambda wraps an http.Handler for AWS Lambda Function URLs (payload format 2.0).

Usage

import (
  lambdaurl "github.com/Origens-Dev/gobeyond/adapters/lambda"
  gbruntime "github.com/Origens-Dev/gobeyond/runtime"
)

func main() {
  server, err := gbruntime.New(/* ... */)
  if err != nil {
    log.Fatal(err)
  }
  // Do not wrap with local disk static middleware in production:
  // CloudFront (or equivalent CDN) should serve SSG HTML and /_gobeyond/*
  // from object storage.
  lambdaurl.Serve(server)
}

Packaging

Item Include in zip?
bootstrap (linux/arm64 binary of this entrypoint) yes
dist/server/render-plans/** yes
dist/server/runtime-data/** yes
dist/server/runtime-manifest.json yes
dist/static/** (assets, SSG HTML, robots) no — sync to object storage / CDN

Runtime: provided.al2023, handler bootstrap, architecture arm64.

Set GOBEYOND_PLAN_DIR (default dist/server/render-plans) so the binary finds packaged plans when the working directory is the unzipped deployment root (place plans next to bootstrap or adjust env).

Edge split

The CDN should send hashed assets, robots.txt, public files, and prebuilt route HTML to object storage. Soft-nav (/_gobeyond/runtime/*), actions, APIs, and dynamic documents should reach this Function URL (AWS_IAM) through your authenticated origin path (for example a reverse proxy that SigV4-signs requests).

Documentation

Overview

Package lambdaurl adapts an http.Handler to an AWS Lambda Function URL (payload format 2.0) entrypoint.

Package as provided.al2023 with a bootstrap binary. Ship render plans and runtime manifests beside bootstrap; do not include dist/static in the zip— hashed assets and SSG HTML belong on S3 behind CloudFront.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dispatch

Dispatch converts a Function URL request into an http.Request, serves it through handler, and returns a Function URL response. Exported for tests.

func Serve

func Serve(handler http.Handler)

Serve starts the Lambda runtime and dispatches Function URL requests to handler. It never returns on success.

Types

This section is empty.

Jump to

Keyboard shortcuts

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