aboutsummaryrefslogtreecommitdiffhomepage
path: root/fst/app.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 /fst/app.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 'fst/app.go')
-rw-r--r--fst/app.go57
1 files changed, 0 insertions, 57 deletions
diff --git a/fst/app.go b/fst/app.go
deleted file mode 100644
index 51ff0d7a..00000000
--- a/fst/app.go
+++ /dev/null
@@ -1,57 +0,0 @@
-// Package fst exports shared fortify types.
-package fst
-
-import (
- "syscall"
- "time"
-)
-
-type App interface {
- // ID returns a copy of [fst.ID] held by App.
- ID() ID
-
- // Seal determines the outcome of config as a [SealedApp].
- // The value of config might be overwritten and must not be used again.
- Seal(config *Config) (SealedApp, error)
-
- String() string
-}
-
-type SealedApp interface {
- // Run commits sealed system setup and starts the app process.
- Run(rs *RunState) error
-}
-
-// RunState stores the outcome of a call to [SealedApp.Run].
-type RunState struct {
- // Time is the exact point in time where the process was created.
- // Location must be set to UTC.
- //
- // Time is nil if no process was ever created.
- Time *time.Time
- // RevertErr is stored by the deferred revert call.
- RevertErr error
- // WaitErr is the generic error value created by the standard library.
- WaitErr error
-
- syscall.WaitStatus
-}
-
-// SetStart stores the current time in [RunState] once.
-func (rs *RunState) SetStart() {
- if rs.Time != nil {
- panic("attempted to store time twice")
- }
- now := time.Now().UTC()
- rs.Time = &now
-}
-
-// Paths contains environment-dependent paths used by fortify.
-type Paths struct {
- // path to shared directory (usually `/tmp/fortify.%d`)
- SharePath string `json:"share_path"`
- // XDG_RUNTIME_DIR value (usually `/run/user/%d`)
- RuntimePath string `json:"runtime_path"`
- // application runtime directory (usually `/run/user/%d/fortify`)
- RunDirPath string `json:"run_dir_path"`
-}