Add notifications on windows

This commit is contained in:
Bernd Schoolmann 2024-02-04 00:49:42 +01:00
parent 7949ed63f3
commit 1933917634
No known key found for this signature in database
2 changed files with 25 additions and 1 deletions

View File

@ -1,4 +1,4 @@
//go:build windows || darwin //go:build darwin
package notify package notify

24
agent/notify/windows.go Normal file
View File

@ -0,0 +1,24 @@
//go:build windows
package notify
import (
"time"
"gopkg.in/toast.v1"
)
func Notify(title string, body string, actionName string, timeout time.Duration, onclose func()) error {
notification := toast.Notification{
AppID: "Goldwarden",
Title: title,
Message: body,
Audio: toast.Silent,
}
return notification.Push()
}
func ListenForNotifications() error {
return nil
}