Help us shape the future of Go! Take the 2026 Go Developer Survey

state

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Overview

Package state persists arcs to the .adh workspace as JSON and provides the lifecycle operations the arc commands drive. The pure state-machine logic lives in internal/adh (NextStage, CanClose, ProofKind); this package is the thin I/O shell around it.

Index

Constants

View Source
const DefaultArcsDir = ".adh/arcs"

DefaultArcsDir is the arc workspace path relative to the repo root.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store reads and writes arcs under a directory (typically .adh/arcs). The directory is created on first write.

func Default

func Default() *Store

Default returns a Store rooted at the default workspace directory.

func NewStore

func NewStore(dir string) *Store

NewStore returns a Store rooted at dir.

func (*Store) Create

func (s *Store) Create(arc *adh.Arc) error

Create writes a new arc, returning ECONFLICT if one with the same ID exists.

func (*Store) Get

func (s *Store) Get(id string) (adh.Arc, error)

Get returns an arc by ID, or ENOTFOUND if it does not exist.

func (*Store) List

func (s *Store) List() ([]adh.Arc, error)

List returns all arcs sorted by ID. An empty or absent workspace is not an error.

func (*Store) NextID

func (s *Store) NextID() (string, error)

NextID returns the next sequential arc ID ("arc-0001"), derived from the current arc count so no clock or randomness is needed.

func (*Store) Save

func (s *Store) Save(arc *adh.Arc) error

Save overwrites an arc, creating the workspace directory if needed.

Jump to

Keyboard shortcuts

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