Documentation ¶
Index ¶
- type Client
- func (c *Client) AddTags(token string, newTags []string) error
- func (c *Client) CheckIn(token string) error
- func (c *Client) CreateSnitch(snitch *Snitch) (*Snitch, error)
- func (c *Client) DeleteSnitch(token string) error
- func (c *Client) GetSnitch(token string) (*Snitch, error)
- func (c *Client) ListSnitches(filters []string) (*[]Snitch, error)
- func (c *Client) PauseSnitch(token string) error
- func (c *Client) RemoveTags(token string, rmTags []string) error
- func (c *Client) UpdateSnitch(token string, updatedSnitch *Snitch) (*Snitch, error)
- type ErrorResponse
- type Snitch
- type Validation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the Dead Man's Snitch API client
func (*Client) CreateSnitch ¶
CreateSnitch creates a new snitch
func (*Client) DeleteSnitch ¶
DeleteSnitch deletes a snitch
func (*Client) ListSnitches ¶
ListSnitches returns a list of snitches with the provided `filters`. An empty filter will result in all snitches.
func (*Client) PauseSnitch ¶
PauseSnitch pauses a snitch
func (*Client) RemoveTags ¶
RemoveTags removes the given tags from the snitch
func (*Client) UpdateSnitch ¶
UpdateSnitch updates the snitch identified by `token` The `updatedSnitch` parameter accepts a Snitch object in which you may provide only the attributes you wish to change. Empty fields in the object will not be touched.
type ErrorResponse ¶
type ErrorResponse struct { ErrorType string `json:"type"` ErrorString string `json:"error"` Validations []Validation `json:"validations"` }
ErrorResponse represents the structure of a API error
type Snitch ¶
type Snitch struct { // The snitch's identifying token. Token string `json:"token,omitempty"` // API URL to retrieve data about this specific Snitch. Href string `json:"href,omitempty"` // The name of the snitch. Name string `json:"name,omitempty"` // The list of keyword tags for this snitch. Tags []string `json:"tags,omitempty"` // The status of the snitch. It could be: // "pending" The snitch is new and your job has not yet checked in. // "healthy" Your job has checked in since the beginning of the last period. // "failed" Your job has not checked in since the beginning of the last period. (At least one alert has been sent.) // "errored" Your job has reported that is has errored. (At least one alert has been sent.) Error Notices are only available on some plans. // "paused" The snitch has been paused and will not worry about your failing job until your job checks-in again after you fix it. Status string `json:"status,omitempty"` // Any user-supplied notes about this snitch. Notes string `json:"notes,omitempty"` // The last time your job checked in healthy, as an ISO 8601 datetime with millisecond precision. The timezone is always UTC. If your job has not checked in healthy yet, this will be null. CheckedInAt string `json:"checked_in_at,omitempty"` // The url your job should hit to check-in. CheckInURL string `json:"check_in_url,omitempty"` // The size of the period window. If your job does not check-in during an entire period, you will be notified and the snitch status will show up as "failed". The interval can be "15_minute", "30_minute", "hourly", "daily", "weekly", or "monthly". Interval string `json:"interval,omitempty"` // The type of alerts the snitch will use. basic will have a static deadline that it will expect to hear from it by, while smart will learn when your snitch checks in, moving the deadline closer so you can be alerted sooner. AlertType string `json:"alert_type,omitempty"` // When the snitch was created, as an ISO 8601 datetime with millisecond precision. The timezone is always UTC. CreatedAt string `json:"created_at,omitempty"` }
Snitch represents the details of a snitch
type Validation ¶
Validation contains the details of a API field validation error