aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/app/export_test.go
blob: 3e5db9fb055b43edbfe124d8afd02b8801e6b485 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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
}