Documentation
¶
Overview ¶
Package state owns the .txco/<stack>.state.json file the txco CLI writes after a `pull` and reads on `push`. It pins which version of a stack a local workspace mirrors, so subsequent pushes set the right parent_version_number on the new draft.
State files are tiny JSON blobs at the root of the local workspace alongside the OPS/ directory:
./OPS/hello-world/... ./.txco/hello-world.state.json
Nested stack names (e.g. "website/canary") use a hyphen-separated filename ("website-canary.state.json") so we don't have to create nested directories under .txco/. Workspace roots are mutable; we don't try to detect renames.
Index ¶
Constants ¶
const Dir = ".txco"
Dir is the workspace-relative directory that holds state files.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type State ¶
type State struct {
// VersionNumber is the per-stack number this workspace mirrors —
// the same int users see in `txco versions <stack>` and in URLs.
VersionNumber int64 `json:"version_number"`
// ParentVersionNumber is what the next `push` will set as the new
// draft's parent_version_number. After a fresh pull it equals
// VersionNumber. The CLI advances this only on the next pull, not
// on push or activate.
ParentVersionNumber int64 `json:"parent_version_number"`
// ManifestHash is what the server reported at pull time. Used by
// `txco push` to short-circuit "no changes locally" before walking
// the tree (Phase 2; harmless to record now).
ManifestHash string `json:"manifest_hash"`
}
State is what the CLI persists per pulled stack.