mirror of
https://github.com/wavetermdev/wails.git
synced 2026-08-05 13:53:43 -07:00
Update plugin example
This commit is contained in:
@@ -6,7 +6,6 @@ import (
|
||||
"plugin_demo/plugins/hashes"
|
||||
|
||||
"github.com/wailsapp/wails/v3/pkg/application"
|
||||
"github.com/wailsapp/wails/v3/plugins/experimental/server"
|
||||
"github.com/wailsapp/wails/v3/plugins/kvstore"
|
||||
"github.com/wailsapp/wails/v3/plugins/log"
|
||||
"github.com/wailsapp/wails/v3/plugins/single_instance"
|
||||
@@ -35,10 +34,10 @@ func main() {
|
||||
Filename: "store.json",
|
||||
AutoSave: true,
|
||||
}),
|
||||
"server": server.NewPlugin(&server.Config{
|
||||
Enabled: true,
|
||||
Port: 34115,
|
||||
}),
|
||||
//"server": server.NewPlugin(&server.Config{
|
||||
// Enabled: true,
|
||||
// Port: 34115,
|
||||
//}),
|
||||
"single_instance": single_instance.NewPlugin(&single_instance.Config{
|
||||
// When true, the original app will be activated when a second instance is launched
|
||||
ActivateAppOnSubsequentLaunch: true,
|
||||
|
||||
@@ -5,6 +5,7 @@ import (
|
||||
"crypto/sha1"
|
||||
"crypto/sha256"
|
||||
"encoding/hex"
|
||||
"github.com/wailsapp/wails/v3/pkg/application"
|
||||
)
|
||||
|
||||
// ---------------- Plugin Setup ----------------
|
||||
@@ -15,13 +16,13 @@ func NewPlugin() *Plugin {
|
||||
return &Plugin{}
|
||||
}
|
||||
|
||||
func (r *Plugin) Shutdown() {}
|
||||
func (r *Plugin) Shutdown() error { return nil }
|
||||
|
||||
func (r *Plugin) Name() string {
|
||||
return "Hashes Plugin"
|
||||
}
|
||||
|
||||
func (r *Plugin) Init() error {
|
||||
func (r *Plugin) Init(api application.PluginAPI) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user