Documentation ¶
Index ¶
- Constants
- func CheckForError(err error, client *NodePingClient) error
- type CheckNotification
- type CheckRequest
- type CheckResponse
- type ClientConfig
- type ContactGroupResponse
- type NodePingClient
- func (c *NodePingClient) GetCheck(id string) (CheckResponse, error)
- func (c *NodePingClient) GetUptime(id string, start, end int64) (map[string]UptimeResponse, error)
- func (c *NodePingClient) ListChecks() ([]CheckResponse, error)
- func (c *NodePingClient) ListContactGroups() (map[string]ContactGroupResponse, error)
- type NodePingError
- type UptimeResponse
Constants ¶
View Source
const BaseURL = "https://api.nodeping.com/api/1"
View Source
const Version = "0.0.1"
Variables ¶
This section is empty.
Functions ¶
func CheckForError ¶
func CheckForError(err error, client *NodePingClient) error
Types ¶
type CheckNotification ¶
type CheckRequest ¶
type CheckRequest struct { ID string `json:"id"` Type string `json:"type"` Target string `json:"target"` Label string `json:"label"` Interval int `json:"interval"` Enabled string `json:"enabled"` Public string `json:"public"` Runlocations []string `json:"runlocations"` Homeloc bool `json:"homeloc"` Threshold int `json:"threshold"` Sens int `json:"sens"` Notifications []CheckNotification `json:"notifications"` Dep string `json:"dep"` Contentstring string `json:"contentstring"` Follow bool `json:"follow"` Data string `json:"data"` Method string `json:"method"` Statuscode string `json:"statuscode"` Ipv6 bool `json:"ipv6"` }
type CheckResponse ¶
type CheckResponse struct { ID string `json:"_id"` Rev string `json:"_rev"` CustomerID string `json:"customer_id"` Label string `json:"label"` Interval int `json:"interval"` Notifications []CheckNotification `json:"notifications"` Type string `json:"type"` Status string `json:"status"` Modified int64 `json:"modified"` Enable string `json:"enable"` Public bool `json:"public"` Parameters struct { Target string `json:"target"` Threshold int `json:"threshold"` Sens int `json:"sens"` } `json:"parameters"` Created int64 `json:"created"` Queue interface{} `json:"queue"` // This is normally a string but can be a bool sometimes UUID string `json:"uuid"` State int `json:"state"` Firstdown int64 `json:"firstdown"` }
type ClientConfig ¶
ClientConfig type includes configuration options for NodePing client.
type ContactGroupResponse ¶
type NodePingClient ¶
type NodePingClient struct { Config ClientConfig Error NodePingError R *resty.Request MockResults string }
NodePingClient holds config and provides methods for various api calls
var Client NodePingClient
func (*NodePingClient) GetCheck ¶
func (c *NodePingClient) GetCheck(id string) (CheckResponse, error)
GetCheck retrieves data about one Check using its id
func (*NodePingClient) GetUptime ¶
func (c *NodePingClient) GetUptime(id string, start, end int64) (map[string]UptimeResponse, error)
GetUptime retrieves the uptime entries for a certain check within an optional date range (by Timestamp with microseconds)
func (*NodePingClient) ListChecks ¶
func (c *NodePingClient) ListChecks() ([]CheckResponse, error)
ListChecks retrieves all the "Checks" in NodePing
func (*NodePingClient) ListContactGroups ¶
func (c *NodePingClient) ListContactGroups() (map[string]ContactGroupResponse, error)
ListContactGroups retrieves the list of Contact Groups
type NodePingError ¶
type NodePingError struct {
Error string `json:"error"`
}
type UptimeResponse ¶
Click to show internal directories.
Click to hide internal directories.