Documentation
¶
Overview ¶
Package store owns the on-disk task state file and the rules for changing it. The daemon holds one Store; daemonless CLI writers go through the same Apply path so the file never sees interleaved writes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Dir ¶
func Dir() string
Dir returns the sideline state directory. SIDELINE_STATE_DIR wins, then XDG_STATE_HOME, then the default under HOME.
func Load ¶
Load reads the state file at path. A missing file yields a fresh empty state, so a first run needs no special casing.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is the owner of the state file at Path. All mutations go through Apply, which serialises in-process callers and takes an exclusive flock so daemonless writers in other processes cannot interleave.
func New ¶
New returns a store for the state file at path, loading the current contents when the file exists.
func (*Store) Apply ¶
Apply applies one request to the state and persists the result. On success the response carries the new state; on failure the file is untouched.
func (*Store) BumpReload ¶
BumpReload increments the reload counter and persists it. Renderers watch the state file, so this is the signal that asks them to re-read the config.