-
Common invocation
package main
import (
"github.com/electricbubble/go-toast"
)
func main() {
_ = toast.Push("test message", toast.WithTitle("app title"))
}
-
macOS
package main
import (
"github.com/electricbubble/go-toast"
)
func main() {
_ = toast.Push("test message",
toast.WithTitle("app title"),
toast.WithSubtitle("app sub title"),
toast.WithAudio(toast.Ping),
)
}
-
Windows
package main
import (
"github.com/electricbubble/go-toast"
)
func main() {
_ = toast.Push("test message",
toast.WithTitle("app title"),
toast.WithAppID("app id"),
toast.WithAudio(toast.Default),
toast.WithLongDuration(),
toast.WithIcon("/path/icon.png"),
)
}
-
js && wasm
package main
import (
"fmt"
"github.com/electricbubble/go-toast"
)
func main() {
_ = toast.Push("test_message",
toast.WithTitle("GO-WASM-APP"),
toast.WithOnClick(func(event interface{}) {
fmt.Println("click")
}),
toast.WithOnClose(func() {
fmt.Println("close")
}),
toast.WithOnShow(func() {
fmt.Println("show")
}),
)
}