A package for sending notifications to a REST API server. It provides the following functionalities:
PushNotificationServer
: Sends a notification to a given REST API server.sendCommandToEdge
: Sends the actual HTTP request to the REST API server.setNotification
: Encodes the notification to JSON or BSON format based on the provided boolean.httpRespToString
: Reads the response body and returns it as a string.
go get github.com/notificationserver
import "github.com/notificationserver"
// Send a notification to the REST API server
err := notificationserver.PushNotificationServer("http://localhost:8080/" + notificationserver.PathRESTV1, map[string]string{notificationserver.TargetCustomer: "111111-1111-1111-1111"}, notificationserver.Notification{}, true)
if err != nil {
// Handle error
}
If you find any bugs or have a feature request, please open an issue or send a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.