loader revisited
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"galaxy/client"
|
||||
"galaxy/client/loader"
|
||||
)
|
||||
|
||||
var Factory loader.ClientInit = client.NewClient
|
||||
+18
-2
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user