Documentation
¶
Overview ¶
Package hostgen generates the source of the shared charly-lib host binary from a DATA pins list (`<name>@<tag>` lines, the format of charly's scripts/host-command-plugins.txt): a go.mod requiring the sdk and each pinned plugin, and a main.go registering each plugin with charlylib.Run. It names no plugin; adding one changes only the pins. Used by the cmd/charly-lib-gen command (the release build) and by deploykit's check-bed build of the in-development package.
Index ¶
Constants ¶
const DefaultGoVersion = "1.26.4"
DefaultGoVersion is the go directive stamped into the generated go.mod.
Variables ¶
This section is empty.
Functions ¶
func CheckGenerated ¶
CheckGenerated verifies outDir's files already equal the generated bytes.
func GoModuleVersion ¶
GoModuleVersion maps a superproject-style git tag `vYYYY.DDD.HHMM` to the Go module version scheme the plugin repos use, `v0.<YYYYDDD>.<HHMM with leading zeros stripped>` (matching the sdk/spec convention; e.g. v2026.239.1615 → v0.2026239.1615).
func RenderGoMod ¶
RenderGoMod emits the host module's go.mod. Requires are sorted (deterministic) with sdk first, then plugins.
func RenderMain ¶
RenderMain emits the argv[0]-dispatch registry literal. The header names the pins file's BASE name (not its path) so output is machine-independent and the reproducibility gate is stable.
Types ¶
type Pin ¶
type Pin struct {
Name string // e.g. "plugin-clean" (the binary base name)
Module string // e.g. "github.com/opencharly/plugin-clean/candy/plugin-clean"
Tag string // e.g. "v2026.239.1615" (the superproject-style git tag)
Version string // e.g. "v0.2026239.1615" (the plugin's Go module version)
}
Pin is one parsed `<name>@<tag>` entry with its derived module path + Go module version.