lambdaurl

package
v0.1.0-alpha.56 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 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.gbp (render-plan pack) yes
dist/server/runtime-data/static-build.gbs (static-entry pack) yes
dist/server/runtime-data/contracts.json yes
dist/server/runtime-manifest.json yes
dist/server/render-plans/** (inspection-only JSON dumps) no
dist/static/** (assets, SSG HTML, robots) no — sync to object storage / CDN

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

Set GOBEYOND_PLAN_PACK (default dist/server/render-plans.gbp) and GOBEYOND_STATIC_PACK (default dist/server/runtime-data/static-build.gbs) so the binary opens the packs when the working directory is the unzipped deployment root (place the packs next to bootstrap or adjust env). The runtime never loads the per-route JSON plan dumps; they exist for human inspection and conformance tooling only.

Edge split

The CDN should send hashed assets, robots.txt, public files, and prebuilt route HTML to object storage. Soft-nav (/_gobeyond/builds/*/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 the render-plan pack (.gbp), static-entry pack (.gbs), contracts, and runtime manifest 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