1
0
mirror of https://github.com/nikoksr/notify.git synced 2025-01-22 03:09:35 +02:00

docs: add documents for bark service

This commit is contained in:
ᴍᴏᴏɴD4ʀᴋ 2022-04-23 19:57:21 +08:00
parent 24d61f6f82
commit c364220b47

View File

@ -11,14 +11,17 @@ import (
"github.com/pkg/errors"
)
// Service allow you to configure Bark service.
type Service struct {
Server string
DeviceKey string
url string
}
// DefaultServer is the default server to use for the bark service.
const DefaultServer = "api.day.app"
// New returns a new instance of Bark service.
func New(deviceKey, server string) *Service {
p := &Service{
Server: server,
@ -32,6 +35,7 @@ func New(deviceKey, server string) *Service {
return p
}
// Send takes a message subject and a message content and sends them to bark application.
func (p *Service) Send(ctx context.Context, subject, content string) error {
select {
case <-ctx.Done():