-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move alert contact into alert_contact.go
- Loading branch information
Showing
2 changed files
with
21 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package uptimerobot | ||
|
||
// AlertContact represents an alert contact. | ||
type AlertContact struct { | ||
ID string `json:"id"` | ||
FriendlyName string `json:"friendly_name"` | ||
Type int `json:"type"` | ||
Status int `json:"status"` | ||
Value string `json:"value"` | ||
} | ||
|
||
const alertContactTemplate = `ID: {{ .ID }} | ||
Name: {{ .FriendlyName }} | ||
Type: {{ .Type }} | ||
Status: {{ .Status }} | ||
Value: {{ .Value }}` | ||
|
||
// String returns a pretty-printed version of the alert contact. | ||
func (a AlertContact) String() string { | ||
return render(alertContactTemplate, a) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters