diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-03-25 01:52:49 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-03-25 01:52:49 +0900 |
| commit | 5c4058d5ac7e7944973ca8216c258fc50c194e22 (patch) | |
| tree | c06597903233c75eca5a1edae8b06d93f0f81774 /internal/app/app.go | |
| parent | e732dca7629edb503df0c65df5f37a99600d567d (diff) | |
app: run in native sandbox
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/app/app.go')
| -rw-r--r-- | internal/app/app.go | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/internal/app/app.go b/internal/app/app.go index c4668a08..42d67b96 100644 --- a/internal/app/app.go +++ b/internal/app/app.go @@ -1,6 +1,7 @@ package app import ( + "context" "fmt" "log" "sync" @@ -10,9 +11,10 @@ import ( "git.gensokyo.uk/security/fortify/internal/sys" ) -func New(os sys.State) (fst.App, error) { +func New(ctx context.Context, os sys.State) (fst.App, error) { a := new(app) a.sys = os + a.ctx = ctx id := new(fst.ID) err := fst.NewAppID(id) @@ -21,8 +23,8 @@ func New(os sys.State) (fst.App, error) { return a, err } -func MustNew(os sys.State) fst.App { - a, err := New(os) +func MustNew(ctx context.Context, os sys.State) fst.App { + a, err := New(ctx, os) if err != nil { log.Fatalf("cannot create app: %v", err) } @@ -32,6 +34,7 @@ func MustNew(os sys.State) fst.App { type app struct { id *stringPair[fst.ID] sys sys.State + ctx context.Context *outcome mu sync.RWMutex @@ -71,7 +74,7 @@ func (a *app) Seal(config *fst.Config) (fst.SealedApp, error) { seal := new(outcome) seal.id = a.id - err := seal.finalise(a.sys, config) + err := seal.finalise(a.ctx, a.sys, config) if err == nil { a.outcome = seal } |
