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 ¶
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.