diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-10-29 04:32:43 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-10-29 04:33:13 +0900 |
| commit | a0b4e47acc228e48165966d8e139277b8f6f450e (patch) | |
| tree | d363a6781536ce946aa445271ca1d3df587e6031 /internal/outcome/main.go | |
| parent | a52f7038e5a607dd0901244abb791c96deaf9c2d (diff) | |
internal/outcome: rename from app
This is less ambiguous, and more accurately describes the purpose of the package.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/outcome/main.go')
| -rw-r--r-- | internal/outcome/main.go | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/internal/outcome/main.go b/internal/outcome/main.go new file mode 100644 index 00000000..06327963 --- /dev/null +++ b/internal/outcome/main.go @@ -0,0 +1,27 @@ +package outcome + +import ( + "context" + "log" + "os" + + "hakurei.app/hst" + "hakurei.app/message" +) + +// Main runs an app according to [hst.Config] and terminates. Main does not return. +func Main(ctx context.Context, msg message.Msg, config *hst.Config) { + var id hst.ID + if err := hst.NewInstanceID(&id); err != nil { + log.Fatal(err.Error()) + } + + seal := outcome{syscallDispatcher: direct{msg}} + if err := seal.finalise(ctx, msg, &id, config); err != nil { + printMessageError("cannot seal app:", err) + os.Exit(1) + } + + seal.main(msg) + panic("unreachable") +} |
