2025-10-24 04:55:10 +01:00
|
|
|
package main
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"embed"
|
|
|
|
|
|
|
|
|
|
"github.com/Snider/Core"
|
|
|
|
|
"github.com/Snider/Core/config"
|
2025-10-24 15:16:34 +01:00
|
|
|
"github.com/Snider/Core/crypt"
|
2025-10-24 04:55:10 +01:00
|
|
|
"github.com/Snider/Core/display"
|
|
|
|
|
"github.com/wailsapp/wails/v3/pkg/application"
|
|
|
|
|
)
|
|
|
|
|
|
2025-10-25 09:24:50 +01:00
|
|
|
//go:embed all:public
|
2025-10-24 04:55:10 +01:00
|
|
|
var assets embed.FS
|
|
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
|
|
|
|
|
|
app := application.New(application.Options{
|
|
|
|
|
Assets: application.AssetOptions{
|
|
|
|
|
Handler: application.AssetFileServerFS(assets),
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
app.RegisterService(application.NewService(core.Service(
|
|
|
|
|
core.WithWails(app), // Provides the Wails application instance to core services
|
|
|
|
|
core.WithAssets(assets), // Provides the embed.FS to core services
|
|
|
|
|
core.WithService(config.Register), // Provides the ability to persist UI state (windows reopen where they closed)
|
2025-10-24 15:16:34 +01:00
|
|
|
core.WithService(display.Register), // Provides the ability to open windows
|
|
|
|
|
core.WithService(crypt.Register), // Provides cryptographic functions
|
2025-10-24 04:55:10 +01:00
|
|
|
core.WithServiceLock(), // locks core from accepting new services blocking access to IPC
|
|
|
|
|
)))
|
|
|
|
|
|
|
|
|
|
err := app.Run()
|
|
|
|
|
if err != nil {
|
|
|
|
|
panic(err)
|
|
|
|
|
}
|
|
|
|
|
}
|