aboutsummaryrefslogtreecommitdiffhomepage
path: root/fst
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-02-18 22:36:45 +0900
committerOphestra <cat@gensokyo.uk>2025-02-18 22:36:45 +0900
commitbf9512733267e2781cf50070a6606d8f1a8bf5d9 (patch)
tree5bd89290493e88f7650cefa35ebe25c6f95131cb /fst
parente0f321b2c4eafba27a93fce93f444b62822c74db (diff)
fst: move App interface declaration
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'fst')
-rw-r--r--fst/app.go33
1 files changed, 33 insertions, 0 deletions
diff --git a/fst/app.go b/fst/app.go
new file mode 100644
index 00000000..31ba484b
--- /dev/null
+++ b/fst/app.go
@@ -0,0 +1,33 @@
+package fst
+
+import "context"
+
+type App interface {
+ // ID returns a copy of App's unique ID.
+ ID() ID
+ // Run sets up the system and runs the App.
+ Run(ctx context.Context, rs *RunState) error
+
+ Seal(config *Config) error
+ String() string
+}
+
+// RunState stores the outcome of a call to [App.Run].
+type RunState struct {
+ // Start is true if fsu is successfully started.
+ Start bool
+ // ExitCode is the value returned by shim.
+ ExitCode int
+ // WaitErr is error returned by the underlying wait syscall.
+ WaitErr error
+}
+
+// Paths contains environment-dependent paths used by fortify.
+type Paths struct {
+ // path to shared directory e.g. /tmp/fortify.%d
+ SharePath string `json:"share_path"`
+ // XDG_RUNTIME_DIR value e.g. /run/user/%d
+ RuntimePath string `json:"runtime_path"`
+ // application runtime directory e.g. /run/user/%d/fortify
+ RunDirPath string `json:"run_dir_path"`
+}