Skip to content

Commit

Permalink
Add yaml tags
Browse files Browse the repository at this point in the history
YAML Unmarshalling tags are now added.

Signed-off-by: Elis Lulja <[email protected]>
  • Loading branch information
asimpleidea committed Dec 21, 2020
1 parent 8009d26 commit 77c2666
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions website_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,27 @@ const (
// WebsitePage contains information of the page to poll
type WebsitePage struct {
// ID of this page
ID string `json:"id"`
ID string `json:"id" yaml:"id"`
// URL to poll
URL string `json:"url"`
URL string `json:"url" yaml:"url"`
// NotifyURL is the url to notify externally
NotifyURL string `json:"notifyUrl"`
NotifyURL *string `json:"notifyUrl" yaml:"notifyUrl,omitempty"`
// UserAgents to use
UserAgents []string `json:"userAgents"`
UserAgents []string `json:"userAgents" yaml:"userAgents,omitempty"`
// PollSettings contains settings about polling
PollSettings `json:"pollSettings"`
PollSettings `json:"pollSettings" yaml:"pollSettings"`
}

// PollSettings contains settings about polling
type PollSettings struct {
// Type of polling
Type PollType `json:"type"`
Type PollType `json:"type" yaml:"type"`
// Frequency of polling, in seconds
Frequency *int `json:"frequency"`
Frequency *int `json:"frequency" yaml:"frequency,omitempty"`
// RandMin is the minimum value that can be extracted
// when random polling
RandMin *int `json:"randMin"`
RandMin *int `json:"randMin" yaml:"randMin,omitempty"`
// RandMin is the maximum value that can be extracted
// when random polling
RandMax *int `json:"randMax"`
RandMax *int `json:"randMax" yaml:"randMax,omitempty"`
}

0 comments on commit 77c2666

Please sign in to comment.