Help us shape the future of Go! Take the 2026 Go Developer Survey

handlerresolve

package
v0.0.0-...-2fd5d2c Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package handlerresolve is the shared extract + merge + collect pipeline used by both the dev and build commands so handler discovery behaves identically across them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RequireCelerityRuntimeSDK

func RequireCelerityRuntimeSDK(appDir, runtime string) error

RequireCelerityRuntimeSDK fails fast at build time with a clear message instead of letting the generated bootstrap fail at Lambda runtime when the Celerity SDK isn't installed.

func RequireRuntimeSDK

func RequireRuntimeSDK(appDir string, resolved *ResolvedHandlers) error

RequireRuntimeSDK checks that the project declares whatever it needs to build and run its handlers.

Prefer this over RequireCelerityRuntimeSDK. For an OS-only runtime the question is not whether a language SDK is installed but whether the resolved toolchain can build an executable at all, which only that toolchain can report. RequireCelerityRuntimeSDK returns nil for a runtime it does not recognise, so calling it directly for an OS-only project checks nothing.

Types

type Extractor

type Extractor interface {
	Extract(ctx context.Context) (*preprocess.HandlerManifest, error)
}

Extractor is an interface (rather than the concrete preprocess.Extractor) so tests can inject a stub without depending on the celerity-extract binary being installed on the host system.

type ExtractorFactory

type ExtractorFactory func(cfg preprocess.ExtractorConfig, logger *zap.Logger) Extractor

ExtractorFactory allows tests to substitute a stub extractor.

type Options

type Options struct {
	AppDir             string
	BlueprintFile      string
	ModulePathOverride string
	// Toolchain builds the handlers executable for an OS-only runtime.
	// Resolved by the caller, which is the only place that has both the app
	// directory and the deploy config; nil for every other runtime.
	Toolchain handlertoolchain.Toolchain
	// DeployTarget and Mode tell the toolchain what it is generating for.
	DeployTarget string
	Mode         string
	// Telemetry names what traces are exported with, or is empty for none.
	Telemetry string
}

Options configures Resolve.

type ResolvedHandlers

type ResolvedHandlers struct {
	Runtime         string
	ModulePath      string
	Handlers        []blueprint.HandlerInfo
	Blueprint       *schema.Blueprint
	MergedBlueprint *schema.Blueprint
	SpecFormat      schema.SpecFormat
	Manifest        *preprocess.HandlerManifest
	// Toolchain builds the handlers executable, and is nil for a runtime that
	// hosts the language itself. Carried here so callers thread the one that
	// was resolved rather than resolving their own.
	Toolchain handlertoolchain.Toolchain
}

ResolvedHandlers is the output of Resolve.

func Resolve

func Resolve(
	ctx context.Context,
	opts Options,
	logger *zap.Logger,
) (*ResolvedHandlers, error)

Resolve extracts an application's handlers and merges them into its blueprint. The merged blueprint is not persisted to disk, which is a dev-specific concern, so callers decide whether to write it out.

Jump to

Keyboard shortcuts

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