Documentation
¶
Overview ¶
Package initbin carries the in-container Lambda init binary, built for each Linux architecture Lambda offers and embedded in the Overcast binary.
Embedding rather than publishing an image: no registry artefact to pull, it works offline, there is no version skew between a host and its init, and native-mode Overcast on Windows or macOS needs no host-visible file to bind mount. The cost is roughly 5 MB on every Overcast binary — less than the SPA. See docs/plans/lambda-in-container-init.md § 3.2.
The artefacts are build output and are NOT committed: dist/ holds a committed .gitkeep so the embed pattern always resolves and a bare `git clone` still builds, vets and tests, exactly as web/dist does for the SPA. Build them with `make lambda-init` (or `task lambda-init`). A build without them is a working Overcast that fails loudly — see For — the first time a function needs an execution environment.
Index ¶
Constants ¶
const EnvDistDir = "OVERCAST_LAMBDA_INIT_DIST"
EnvDistDir names a directory to read the artefacts from INSTEAD of the embedded copies. Two audiences, neither of them production:
- The repository's own test binaries. An embed is baked at compile time, so a test binary compiled from a bare checkout — before `make lambda-init` has ever run — carries no init, and nothing it builds mid-run can change that. The test bootstraps (this package's users have one each: internal/services/lambda's TestMain and tests/helpers/lambdafixture's EnsureInit) build the artefacts and point this variable at dist/, so the FIRST `go test` on a fresh clone passes rather than the second.
- A developer iterating on the init itself, who wants a container to run a freshly built copy without relinking Overcast.
When unset — every production deployment — the embedded copies are the only source, and a build without them fails loudly as documented on For.
Variables ¶
This section is empty.
Functions ¶
func For ¶
For returns the init binary for a Lambda Architectures value ("x86_64" or "arm64"; empty means x86_64).
When this build has no such artefact the error names the file that is missing and the command that produces it. It is deliberately loud: a silent fallback would mean an execution environment without an init, which is a container whose logs cannot be attributed to an invocation — the exact failure this whole mechanism exists to remove.
Types ¶
This section is empty.