feat: Initial
This commit is contained in:
commit
f0abca60db
26 files changed
+1112
No files matched your search
+37
@@ -0,0 +1,37 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
ua "go.mrlokop.dev/universe/core/app"
|
||||
uc "go.mrlokop.dev/universe/core/config"
|
||||
"go.uber.org/fx"
|
||||
"log"
|
||||
"time"
|
||||
)
|
||||
|
||||
func main() {
|
||||
runDirectory := "run"
|
||||
|
||||
cfg := new(uc.UniverseConfig)
|
||||
err := uc.LoadConfigFromDirectory(runDirectory, cfg)
|
||||
if err != nil {
|
||||
log.Fatalf("Error loading config: %v", err)
|
||||
}
|
||||
|
||||
app := ua.NewUniverseApplication(cfg)
|
||||
|
||||
create, err := ua.Module.Create("$base", make(map[string]interface{}))
|
||||
if err != nil {
|
||||
log.Fatalf("Error creating base module: %v", err)
|
||||
}
|
||||
|
||||
app.WithOption(
|
||||
fx.StartTimeout(10*time.Minute),
|
||||
fx.Supply(cfg),
|
||||
create,
|
||||
)
|
||||
|
||||
err = app.Run()
|
||||
if err != nil {
|
||||
log.Fatalln(err.Error())
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user