aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/app/export_linux_test.go
blob: f7af527fda340d42d5ef5fc37c67206acb73c318 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package app

import (
	"hakurei.app/container"
	"hakurei.app/internal/app/state"
	"hakurei.app/internal/sys"
	"hakurei.app/system"
)

func NewWithID(id state.ID, os sys.State) *App {
	a := new(App)
	a.id = newID(&id)
	a.sys = os
	return a
}

func AppIParams(a *App, sa SealedApp) (*system.I, *container.Params) {
	seal := sa.(*outcome)
	if a.outcome != seal || a.id != seal.id {
		panic("broken app/outcome link")
	}
	return seal.sys, seal.container
}