-
Notifications
You must be signed in to change notification settings - Fork 0
/
scene.go
37 lines (29 loc) · 1.07 KB
/
scene.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package scene
import "context"
type AppContainerStatus int
const (
AppContainerStatusStopped AppContainerStatus = iota
AppContainerStatusRunning
AppContainerStatusError
)
type ApplicationFactory[T Application] interface {
Name() string // return factory name
Create(app T) error // create application
Destroy(app T) error // not used for now
}
type ApplicationManager[T Application] interface {
Name() string // return registry name
LoadApp(app T) error // load application
LoadApps(apps ...T) error // load applications
GetApp(appID string) T // return application
ListAppNames() []string // return application names
ListApps() []T // return list of applications
}
type ApplicationContainer interface {
Name() ImplName // return container name
Start() error // start container
Stop(ctx context.Context) error // stop container
// Status() AppContainerStatus // return container status
// GetAppInfo(appID string) Application // return application info
ListAppNames() []string // return application names
}