diff options
Diffstat (limited to 'internal/app/state/state.go')
| -rw-r--r-- | internal/app/state/state.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/internal/app/state/state.go b/internal/app/state/state.go index 59fbc8c7..b8d8d255 100644 --- a/internal/app/state/state.go +++ b/internal/app/state/state.go @@ -3,12 +3,12 @@ package state import ( "errors" - "io" "time" "hakurei.app/hst" ) +// ErrNoConfig is returned by [Cursor] when used with a nil [hst.Config]. var ErrNoConfig = errors.New("state does not contain config") type Entries map[ID]*State @@ -27,23 +27,23 @@ type Store interface { Close() error } -// Cursor provides access to the store +// Cursor provides access to the store of an identity. type Cursor interface { - Save(state *State, configWriter io.WriterTo) error + Save(state *State) error Destroy(id ID) error Load() (Entries, error) Len() (int, error) } -// State is an instance state +// State is the on-disk state of a container instance. type State struct { - // hakurei instance id + // Unique instance id, generated by internal/app. ID ID `json:"instance"` - // child process PID value + // Shim process pid. This runs as the target user. PID int `json:"pid"` - // sealed app configuration + // Configuration value used to start the container. Config *hst.Config `json:"config"` - // process start time + // Exact point in time that the shim process was created. Time time.Time `json:"time"` } |
