Documentation ¶
Index ¶
- 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 GotifyConfig
- type MessageTemplateData
- type NtfyClient
- type NtfyConfig
- type RenderMessageOption
- type TelegramClient
- type TelegramConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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(config GotifyConfig) (GotifyClient, error)
func (GotifyClient) SendTicketNotification ¶
func (g GotifyClient) SendTicketNotification(ticket twigots.TicketListing) error
type GotifyConfig ¶
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 // Footer Link string }
type NtfyClient ¶
type NtfyClient struct {
// contains filtered or unexported fields
}
func NewNtfyClient ¶
func NewNtfyClient(config NtfyConfig) (NtfyClient, error)
func (NtfyClient) SendTicketNotification ¶
func (c NtfyClient) SendTicketNotification(ticket twigots.TicketListing) error
type NtfyConfig ¶
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(config TelegramConfig) (TelegramClient, error)
func (TelegramClient) SendTicketNotification ¶
func (c TelegramClient) SendTicketNotification(ticket twigots.TicketListing) error
type TelegramConfig ¶
Click to show internal directories.
Click to hide internal directories.