Files
hakurei/internal/app/app.go
Ophestra ae2df2c450 internal: remove sys package
This package is replaced by container/stub. Remove and replace it with unexported implementation for the upcoming test suite rewrite.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-09-25 13:51:54 +09:00

29 lines
630 B
Go

// Package app implements high-level hakurei container behaviour.
package app
import (
"context"
"log"
"os"
"hakurei.app/hst"
"hakurei.app/internal/app/state"
)
// Main runs an app according to [hst.Config] and terminates. Main does not return.
func Main(ctx context.Context, config *hst.Config) {
var id state.ID
if err := state.NewAppID(&id); err != nil {
log.Fatal(err)
}
seal := outcome{id: &stringPair[state.ID]{id, id.String()}, syscallDispatcher: direct{}}
if err := seal.finalise(ctx, config); err != nil {
printMessageError("cannot seal app:", err)
os.Exit(1)
}
seal.main()
panic("unreachable")
}