-
Notifications
You must be signed in to change notification settings - Fork 8
/
main.fn.go
35 lines (27 loc) · 911 Bytes
/
main.fn.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
// This file was automatically generated by Namespace.
// DO NOT EDIT. To update, re-run `ns generate`.
// This file was automatically generated.
package main
import (
"context"
"flag"
"namespacelabs.dev/foundation/std/go/core"
"namespacelabs.dev/foundation/std/go/server"
)
func main() {
flag.Parse()
resources := core.PrepareEnv("namespacelabs.dev/foundation/orchestration/server")
defer resources.Close(context.Background())
ctx := core.WithResources(context.Background(), resources)
depgraph := core.NewDependencyGraph()
RegisterInitializers(depgraph)
if err := depgraph.RunInitializers(ctx); err != nil {
core.ZLog.Fatal().Err(err).Send()
}
server.InitializationDone()
server.Listen(ctx, func(srv server.Server) {
if errs := WireServices(ctx, srv, depgraph); len(errs) > 0 {
core.ZLog.Fatal().Errs("errors", errs).Msgf("%d services failed to initialize.", len(errs))
}
})
}