Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action struct {
Action string `json:"action"`
Label string `json:"label"`
URL string `json:"url"`
}
Action represents a custom user action button for notifications
type HealthMonitor ¶
type HealthMonitors ¶
type HealthMonitors int8
const ( HealthChecksIO HealthMonitors = iota BetterUptime )
type Message ¶
type Message struct {
Topic string `json:"topic"`
Message string `json:"message,omitempty"`
Title string `json:"title,omitempty"`
Tags []string `json:"tags,omitempty"`
Priority Priority `json:"priority,omitempty"`
Actions []Action `json:"actions,omitempty"`
ClickUrl *url.URL `json:"click,omitempty"`
IconUrl *url.URL `json:"icon,omitempty"`
Delay time.Duration `json:"delay,omitempty"`
Email string `json:"email,omitempty"`
}
type MsgOptFunc ¶
type MsgOptFunc func(*Message)
func WithActions ¶
func WithActions(actions ...Action) MsgOptFunc
func WithClickUrl ¶
func WithClickUrl(clickUrl *url.URL) MsgOptFunc
func WithDelay ¶
func WithDelay(seconds int) MsgOptFunc
func WithEmail ¶
func WithEmail(email string) MsgOptFunc
func WithIcon ¶
func WithIcon(iconUrl *url.URL) MsgOptFunc
func WithPriority ¶
func WithPriority(priority Priority) MsgOptFunc
type Notifier ¶
type Notifier struct {
// ntfy.sh
Host string
Topic string
Token string
// Health
HealthMonitors []HealthMonitors
}
func NewNotifier ¶
func NewNotifierFromEnv ¶
func (*Notifier) SendHeartbeats ¶
Click to show internal directories.
Click to hide internal directories.