aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/state/state.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-04-12 13:56:41 +0900
committerOphestra <cat@gensokyo.uk>2025-04-12 13:56:41 +0900
commit6309469e933a31a300fbf16d8e77f48dcee402d3 (patch)
tree8f8a72ee02b3ca15b104a6e55c9379e20f8d7e8a /internal/state/state.go
parent0d7c1a9a4356614f035225aeb24e66421879a99b (diff)
app/instance: wrap internal implementation
This reduces the scope of the fst package, which was growing questionably large. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/state/state.go')
-rw-r--r--internal/state/state.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/internal/state/state.go b/internal/state/state.go
index 6e76d517..609b4e92 100644
--- a/internal/state/state.go
+++ b/internal/state/state.go
@@ -6,11 +6,12 @@ import (
"time"
"git.gensokyo.uk/security/fortify/fst"
+ "git.gensokyo.uk/security/fortify/internal/app"
)
var ErrNoConfig = errors.New("state does not contain config")
-type Entries map[fst.ID]*State
+type Entries map[app.ID]*State
type Store interface {
// Do calls f exactly once and ensures store exclusivity until f returns.
@@ -29,7 +30,7 @@ type Store interface {
// Cursor provides access to the store
type Cursor interface {
Save(state *State, configWriter io.WriterTo) error
- Destroy(id fst.ID) error
+ Destroy(id app.ID) error
Load() (Entries, error)
Len() (int, error)
}
@@ -37,7 +38,7 @@ type Cursor interface {
// State is a fortify process's state
type State struct {
// fortify instance id
- ID fst.ID `json:"instance"`
+ ID app.ID `json:"instance"`
// child process PID value
PID int `json:"pid"`
// sealed app configuration