Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CallBack ¶
type CallBack func(*WebsitePage, *http.Response, error)
CallBack is a pointer to a function that must be executed after an http call is performed
type PollSettings ¶
type PollSettings struct { // Type of polling Type PollType `json:"type" yaml:"type"` // Frequency of polling, in seconds Frequency *int `json:"frequency" yaml:"frequency,omitempty"` // RandMin is the minimum value that can be extracted // when random polling RandMin *int `json:"randMin" yaml:"randMin,omitempty"` // RandMin is the maximum value that can be extracted // when random polling RandMax *int `json:"randMax" yaml:"randMax,omitempty"` }
PollSettings contains settings about polling
type Poller ¶
type Poller interface { Start(ctx context.Context, exitChan chan struct{}) AddUserAgents(uas []string) AddPage(page *WebsitePage, f CallBack) RemovePage(id string) }
Poller performs continous polling to websites
type WebsitePage ¶
type WebsitePage struct { // ID of this page ID string `json:"id" yaml:"id"` // WebsiteName is the name of the website WebsiteName string `json:"websiteName" yaml:"websiteName"` // ProductName is the name of the product polled ProductName string `json:"productName" yaml:"productName"` // URL to poll URL string `json:"url" yaml:"url"` // NotifyURL is the url to notify externally NotifyURL *string `json:"notifyUrl" yaml:"notifyUrl,omitempty"` // UserAgents to use UserAgents []string `json:"userAgents" yaml:"userAgents,omitempty"` // PollSettings contains settings about polling PollSettings `json:"pollSettings" yaml:"pollSettings"` }
WebsitePage contains information of the page to poll
Click to show internal directories.
Click to hide internal directories.