initbin

package
v0.0.1-alpha.44 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
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

func For(arch string) ([]byte, error)

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.

func Present

func Present(arch string) bool

Present reports whether this build can serve an init for arch. It lets a caller fail at function create, where the user is looking, rather than at the first invoke.

Types

This section is empty.

Jump to

Keyboard shortcuts

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