A Go package that enables developers to send push notifications seamlessly through the Pushinator API.
Install the package using go get:
go get github.com/appricos/pushinator-goTo start using the pushinator-go package, create a client instance by passing your API token:
package main
import (
pushinator "github.com/appricos/pushinator-go"
)
func main() {
client := pushinator.NewClient("PUSHINATOR_API_TOKEN")
}To send a notification to a specific channel, use the SendNotification method. Provide your channel ID and the notification content as arguments:
package main
import (
"fmt"
"log"
pushinator "github.com/appricos/pushinator-go"
)
func main() {
client := pushinator.NewClient("PUSHINATOR_API_TOKEN")
err := client.SendNotification("PUSHINATOR_CHANNEL_ID", "Hello from Go! ๐")
if err != nil {
log.Fatalf("Error: %v", err)
}
fmt.Println("โ
Notification sent successfully!")
}