state

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package state manages the recording state file for cross-invocation coordination.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clear

func Clear(path string) error

Clear removes the state file.

func Write

func Write(path string, s *State) error

Write persists state to the given path.

Types

type State

type State struct {
	Recording bool      `json:"recording"`
	Paused    bool      `json:"paused"`
	PID       int       `json:"pid"`
	File      string    `json:"file"`
	StartedAt time.Time `json:"started_at"`
	Countdown int       `json:"countdown,omitempty"`
}

State represents the current recording state persisted to disk.

func Read

func Read(path string) (*State, error)

Read loads state from the given path. Returns an idle state if the file doesn't exist or contains invalid JSON. Cleans up stale PIDs automatically.

Jump to

Keyboard shortcuts

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