statefile

package
v0.14.8 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: MIT Imports: 7 Imported by: 0

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.

func Write

func Write(ctx context.Context, logger *slogutil.Logger, flags *state.Flags, path string, s *state.State) error

Write stores the state where it was read from.

Types

This section is empty.

Jump to

Keyboard shortcuts

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