Skip to content

Commit

Permalink
Move alert contact into alert_contact.go
Browse files Browse the repository at this point in the history
  • Loading branch information
bitfield committed Aug 13, 2019
1 parent 60503f7 commit c6653fa
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 20 deletions.
21 changes: 21 additions & 0 deletions pkg/alert_contact.go
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)
}
20 changes: 0 additions & 20 deletions pkg/uptimerobot.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,26 +51,6 @@ type Response struct {
Error Error `json:"error"`
}

// 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)
}

// GetAccountDetails returns an Account representing the account details.
func (c *Client) GetAccountDetails() (Account, error) {
r := Response{}
Expand Down

0 comments on commit c6653fa

Please sign in to comment.