loader revisited

This commit is contained in:
Ilia Denisov
2026-03-16 19:52:02 +02:00
committed by GitHub
parent e6c6970947
commit 3f1776aa5f
30 changed files with 1581 additions and 527 deletions
+3 -2
View File
@@ -4,6 +4,7 @@ import (
"context"
"errors"
"fmt"
"galaxy/client/appmeta"
"galaxy/client/loader"
"galaxy/connector/http"
"galaxy/storage/fs"
@@ -30,12 +31,12 @@ func main() {
ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt)
defer cancel()
app := app.NewWithID("GalaxyPlus")
app := app.NewWithID(appmeta.AppID)
s, err := fs.NewFS(app.Storage().RootURI().Path())
if err != nil {
return
}
c, err := http.NewHttpConnector(ctx, "http://127.0.0.1:8080")
c, err := http.NewHttpConnector(ctx, appmeta.DefaultBackendURL)
if err != nil {
return
}
-8
View File
@@ -1,8 +0,0 @@
package main
import (
"galaxy/client"
"galaxy/client/loader"
)
var Factory loader.ClientInit = client.NewClient
+18 -2
View File
@@ -1,10 +1,15 @@
package main
import (
"context"
"errors"
"fmt"
"galaxy/client/appmeta"
"galaxy/client"
"galaxy/connector/http"
"galaxy/storage/fs"
"os"
"os/signal"
"fyne.io/fyne/v2/app"
)
@@ -22,8 +27,19 @@ func main() {
os.Exit(1)
}
}()
app := app.New()
c, err := client.NewClient(nil, nil, app)
ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt)
defer cancel()
app := app.NewWithID(appmeta.AppID)
s, err := fs.NewFS(app.Storage().RootURI().Path())
if err != nil {
return
}
conn, err := http.NewHttpConnector(ctx, appmeta.DefaultBackendURL)
if err != nil {
return
}
c, err := client.NewClient(s, conn, app)
if err != nil {
return
}