mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-04 20:11:27 +08:00

* Test release workflow * Update release.yml * Update release.yml * add linux deps * Update release.yml * Update release.yml * Update release.yml * Update release.yml * Update release.yml * Update release.yml * Update release.yml * Update release.yml * Update release.yml * Fix: Misc tests * Fix: Misc tests + linux build tags * Fix: Bindings tests + move templates to pkg. Add json schema for templates * Fix: template tests * Add tests to release workflow. Test for go 1.18 + go 1.19 Fix: ignore .m files for non darwin builds. Fix watcher test. Fix warning in clilogger. * Fix release pipeline * Matrix for tests * Rename templates to make tests work * Update template test * Debug template test * Debug template test * Debug template test * Fix gitignore * Update release.yml
45 lines
1.0 KiB
Go
45 lines
1.0 KiB
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
)
|
|
|
|
// App struct
|
|
type App struct {
|
|
ctx context.Context
|
|
}
|
|
|
|
// NewApp creates a new App application struct
|
|
func NewApp() *App {
|
|
return &App{}
|
|
}
|
|
|
|
// startup is called at application startup
|
|
func (a *App) startup(ctx context.Context) {
|
|
// Perform your setup here
|
|
a.ctx = ctx
|
|
}
|
|
|
|
// domReady is called after front-end resources have been loaded
|
|
func (a App) domReady(ctx context.Context) {
|
|
// Add your action here
|
|
}
|
|
|
|
// beforeClose is called when the application is about to quit,
|
|
// either by clicking the window close button or calling runtime.Quit.
|
|
// Returning true will cause the application to continue, false will continue shutdown as normal.
|
|
func (a *App) beforeClose(ctx context.Context) (prevent bool) {
|
|
return false
|
|
}
|
|
|
|
// shutdown is called at application termination
|
|
func (a *App) shutdown(ctx context.Context) {
|
|
// Perform your teardown here
|
|
}
|
|
|
|
// Greet returns a greeting for the given name
|
|
func (a *App) Greet(name string) string {
|
|
return fmt.Sprintf("Hello %s, It's show time!", name)
|
|
}
|