-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
52 lines (44 loc) · 1.06 KB
/
main.go
File metadata and controls
52 lines (44 loc) · 1.06 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package main
import (
"embed"
"fmt"
"log"
"urodstvo-launcher/auth"
"urodstvo-launcher/launcher"
"github.com/wailsapp/wails/v3/pkg/application"
)
//go:embed all:frontend/dist
var assets embed.FS
func main() {
authService := auth.NewAuthService()
launcherService := launcher.NewLauncherService()
app := application.New(application.Options{
Name: "Minecraft Launcher",
Description: "by urodstvo",
Services: []application.Service{
application.NewService(launcherService, application.ServiceOptions{}),
application.NewService(authService, application.ServiceOptions{}),
},
Assets: application.AssetOptions{
Handler: application.AssetFileServerFS(assets),
},
Mac: application.MacOptions{
ApplicationShouldTerminateAfterLastWindowClosed: true,
},
ErrorHandler: func(err error) {
fmt.Println(err.Error())
},
WarningHandler: func(s string) {
fmt.Println(s)
},
PanicHandler: func(a any) {
fmt.Printf("%v\n", a)
},
})
launcherService.SetApp(app)
authService.SetApp(app)
err := app.Run()
if err != nil {
log.Fatal(err)
}
}