aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/app/state/state.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/app/state/state.go')
-rw-r--r--internal/app/state/state.go22
1 files changed, 3 insertions, 19 deletions
diff --git a/internal/app/state/state.go b/internal/app/state/state.go
index b8d8d255..ef783bfb 100644
--- a/internal/app/state/state.go
+++ b/internal/app/state/state.go
@@ -3,7 +3,6 @@ package state
import (
"errors"
- "time"
"hakurei.app/hst"
)
@@ -11,8 +10,6 @@ import (
// 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
-
type Store interface {
// Do calls f exactly once and ensures store exclusivity until f returns.
// Returns whether f is called and any errors during the locking process.
@@ -29,21 +26,8 @@ type Store interface {
// Cursor provides access to the store of an identity.
type Cursor interface {
- Save(state *State) error
- Destroy(id ID) error
- Load() (Entries, error)
+ Save(state *hst.State) error
+ Destroy(id hst.ID) error
+ Load() (map[hst.ID]*hst.State, error)
Len() (int, error)
}
-
-// State is the on-disk state of a container instance.
-type State struct {
- // Unique instance id, generated by internal/app.
- ID ID `json:"instance"`
- // Shim process pid. This runs as the target user.
- PID int `json:"pid"`
- // Configuration value used to start the container.
- Config *hst.Config `json:"config"`
-
- // Exact point in time that the shim process was created.
- Time time.Time `json:"time"`
-}