Documentation ¶
Overview ¶
Package bark provides a service for sending messages to bark.
Usage:
package main import ( "context" "log" "github.com/casdoor/notify" "github.com/casdoor/notify/service/bark" ) func main() { // Create a bark service. `device key` is generated when you install the application. You can use the // `bark.NewWithServers` function to create a service with a custom server. barkService := bark.NewWithServers("your bark device key", bark.DefaultServerURL) // Or use `bark.New` to create a service with the default server. barkService = bark.New("your bark device key") // Tell our notifier to use the bark service. notify.UseServices(barkService) // Send a test message. _ = notify.Send( context.Background(), "Subject/Title", "The actual message - Hello, you awesome gophers! :)", ) }
Index ¶
Constants ¶
const DefaultServerURL = "https://api.day.app/"
DefaultServerURL is the default server to use for the bark service.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service allow you to configure Bark service.
func New ¶
New returns a new instance of Bark service. You can use this service to send messages to bark. By default, the service will use the default server (https://api.day.app/).
func NewWithServers ¶
NewWithServers returns a new instance of Bark service. You can use this service to send messages to bark. You can specify the servers to send the messages to. By default, the service will use the default server (https://api.day.app/) if you don't specify any servers.
func (*Service) AddReceivers ¶
AddReceivers adds server URLs to the list of servers to use for sending messages. We call it Receivers and not servers because strictly speaking, the server is still receiving the message, and additionally we're following the naming convention of the other services.