2025-02-18 22:36:45 +09:00
|
|
|
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 {
|
2025-02-19 13:41:06 +09:00
|
|
|
// path to shared directory (usually `/tmp/fortify.%d`)
|
2025-02-18 22:36:45 +09:00
|
|
|
SharePath string `json:"share_path"`
|
2025-02-19 13:41:06 +09:00
|
|
|
// XDG_RUNTIME_DIR value (usually `/run/user/%d`)
|
2025-02-18 22:36:45 +09:00
|
|
|
RuntimePath string `json:"runtime_path"`
|
2025-02-19 13:41:06 +09:00
|
|
|
// application runtime directory (usually `/run/user/%d/fortify`)
|
2025-02-18 22:36:45 +09:00
|
|
|
RunDirPath string `json:"run_dir_path"`
|
|
|
|
}
|