Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct {
Type Type
WebsiteName string
Message string
ProductID string
URL string
Date time.Time
ToTelegramChat []string
Attributes map[string]string
}
Event represents a poll event
type Options ¶
type Options func(*Event)
Options represents an option to add to the event
func WithAttributes ¶
WithAttributes adds map of attributes to the event
func WithCustomDate ¶
WithCustomDate adds a date to the event
func WithCustomMessage ¶
WithCustomMessage adds a message to the event
func WithProductID ¶
WithProductID adds the product ID to the event
func WithTelegramNotification ¶
WithTelegramNotification adds a chat that must be notified with telegram
type Type ¶
type Type string
Type is the event type that this event represents
const ( // EventGeneral is a general notification EventGeneral Type = "general" // EventUnexpected means that something unexpected happened to the poller EventUnexpected Type = "unexpected" // EventError means that an error happened during polling EventError Type = "error" EventUnavailable Type = "unavailable" // EventSuccess means that a product is available EventSuccess Type = "available" // EventProbable means that a product is probably available EventProbable Type = "probable" )
Click to show internal directories.
Click to hide internal directories.