forked from security/hakurei
The mutex is not really doing anything, none of these methods make sense when called concurrently anyway. The copylocks analysis is still satisfied by the noCopy struct. Signed-off-by: Ophestra <cat@gensokyo.uk>
22 lines
455 B
Go
22 lines
455 B
Go
package app
|
|
|
|
import (
|
|
"context"
|
|
|
|
"hakurei.app/container"
|
|
"hakurei.app/internal/app/state"
|
|
"hakurei.app/internal/sys"
|
|
"hakurei.app/system"
|
|
)
|
|
|
|
func NewWithID(ctx context.Context, id state.ID, os sys.State) *App {
|
|
return &App{id: newID(&id), sys: os, ctx: ctx}
|
|
}
|
|
|
|
func AppIParams(a *App, seal *Outcome) (*system.I, *container.Params) {
|
|
if a.outcome != seal || a.id != seal.id {
|
|
panic("broken app/outcome link")
|
|
}
|
|
return seal.sys, seal.container
|
|
}
|