Documentation
¶
Index ¶
- func GetNotificationClients(conf config.NotificationConfig) (map[config.NotificationType]Client, error)
- func NtfyViewAction(label string, link *string, params ...map[string]string) string
- func RenderMessage(ticket twigots.TicketListing, options ...RenderMessageOption) (string, error)
- type Client
- type GotifyClient
- type MessageTemplateData
- type NtfyClient
- type RenderMessageOption
- type TelegramClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetNotificationClients ¶ added in v1.0.0
func GetNotificationClients(conf config.NotificationConfig) (map[config.NotificationType]Client, error)
func NtfyViewAction ¶
NtfyViewAction creates a ntfy actions string for a single view actions See https://docs.ntfy.sh/publish/#using-a-json-array
func RenderMessage ¶
func RenderMessage(ticket twigots.TicketListing, options ...RenderMessageOption) (string, error)
Types ¶
type Client ¶
type Client interface {
SendTicketNotification(twigots.TicketListing) error
}
type GotifyClient ¶
type GotifyClient struct {
// contains filtered or unexported fields
}
func NewGotifyClient ¶
func NewGotifyClient(conf config.GotifyConfig) (GotifyClient, error)
func (GotifyClient) SendTicketNotification ¶
func (g GotifyClient) SendTicketNotification(ticket twigots.TicketListing) error
type MessageTemplateData ¶
type MessageTemplateData struct {
// Header
Event string
// Body
Date string
Time string
Venue string
Location string
TicketType string // Standing, Stalls etc.
NumTickets int
TotalTicketPrice string
TotalPrice string
OriginalTicketPrice string
OriginalTotalPrice string
Discount string
AcceptsOffers bool
// Footer
Link string
}
type NtfyClient ¶
type NtfyClient struct {
// contains filtered or unexported fields
}
func NewNtfyClient ¶
func NewNtfyClient(conf config.NtfyConfig) (NtfyClient, error)
func (NtfyClient) SendTicketNotification ¶
func (c NtfyClient) SendTicketNotification(ticket twigots.TicketListing) error
type RenderMessageOption ¶
type RenderMessageOption func(*renderMessageConfig)
func WithFooter ¶
func WithFooter() RenderMessageOption
Whether to include buy link footer in message
func WithHeader ¶
func WithHeader() RenderMessageOption
Whether to include event name header in message
type TelegramClient ¶
type TelegramClient struct {
// contains filtered or unexported fields
}
func NewTelegramClient ¶
func NewTelegramClient(conf config.TelegramConfig) (TelegramClient, error)
func (TelegramClient) SendTicketNotification ¶
func (c TelegramClient) SendTicketNotification(ticket twigots.TicketListing) error
Click to show internal directories.
Click to hide internal directories.