Documentation
¶
Overview ¶
Package statefile reads and writes ar2's state where the commands keep it.
The state lives in a container registry rather than in the repository, since it changes on every run and would add a commit each time. A local file is the other way in, which is what makes a run reproducible while working on one.
It is shared because more than one command has to agree on where the state is: a run reads the order and records what it did, and adding a package puts it into that order.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Read ¶
func Read(ctx context.Context, logger *slogutil.Logger, flags *state.Flags, path string) (*state.State, error)
Read reads the state that orders the work.
It comes from the container registry, where 'ar2 init' put it. A path reads a local file instead.
A registry that holds none is not a failure: that is what it looks like before 'ar2 init' has ever run, and an empty state is enough, since every package is new to it and whatever syncs will build the whole thing.
Types ¶
This section is empty.