This commit is contained in:
Matej Kramny
2015-03-20 20:58:56 +01:00
parent cdf51d89f6
commit d421b35e9b
7 changed files with 52 additions and 52 deletions

View File

@@ -1,22 +1,22 @@
package cachet
import (
"encoding/json"
"fmt"
"strconv"
"encoding/json"
)
// Incident Cachet data model
type Incident struct {
ID int `json:"id"`
Name string `json:"name"`
Message string `json:"message"`
Status int `json:"status"`// 4?
HumanStatus string `json:"human_status"`
Component *Component `json:"component"`
ComponentID *int `json:"component_id"`
CreatedAt int `json:"created_at"`
UpdatedAt int `json:"updated_at"`
ID int `json:"id"`
Name string `json:"name"`
Message string `json:"message"`
Status int `json:"status"` // 4?
HumanStatus string `json:"human_status"`
Component *Component `json:"component"`
ComponentID *int `json:"component_id"`
CreatedAt int `json:"created_at"`
UpdatedAt int `json:"updated_at"`
}
// IncidentData is a response when creating/updating an incident
@@ -75,7 +75,7 @@ func (incident *Incident) Send() {
incident.ID = data.Incident.ID
}
fmt.Println("ID:"+strconv.Itoa(incident.ID))
fmt.Println("ID:" + strconv.Itoa(incident.ID))
if resp.StatusCode != 200 {
fmt.Println("Could not create/update incident!")
@@ -118,4 +118,4 @@ func (incident *Incident) SetWatching() {
func (incident *Incident) SetFixed() {
incident.Status = 4
incident.HumanStatus = "Fixed"
}
}