Documentation
¶
Overview ¶
Package state reads and writes .keel/state.json, the record of which modules keel init (and later keel add) selected for a generated project. Before this package existed, keel init left no trace of its own module selection anywhere in the generated output — keel add has nothing else to read to find out what's already present.
Index ¶
Constants ¶
const RelPath = ".keel/state.json"
RelPath is state.json's path relative to a project's root.
const SchemaVersion = 1
SchemaVersion is the current .keel/state.json schema. Bump it and handle migration explicitly if the shape ever needs to change — the same posture module.yaml's own apiVersion field takes.
Variables ¶
var ErrNotFound = errors.New("state: no .keel/state.json found")
ErrNotFound is returned by Load when projectDir has no .keel/state.json — keel add turns this into its own "this directory wasn't generated by keel init" message; it is not itself a generic I/O error.
Functions ¶
Types ¶
type Module ¶
Module records one resolved module's name and version. Deliberately nothing else — no content hash, no per-file record. Hashing would serve drift/upgrade detection, a different problem than keel add's actual need (knowing what's already selected, to compute a correct resolver.Resolve call); adding it now would be speculative scope for a problem nothing yet asks to solve.