Versions in this module Expand all Collapse all v0 v0.0.1 Oct 28, 2019 Changes in this version + const TypeBrowser + const TypeScriptAPI + const TypeScriptBrowser + const TypeSimple + var ErrAlertConditionNotFound = errors.New("error: alert condition not found") + var ErrMonitorNotFound = errors.New("error: monitor not found") + var ErrMonitorScriptNotFound = errors.New("error: monitor script not found") + type AlertCondition struct + Enabled bool + ID uint + MonitorID string + Name string + RunbookURL string + type Client struct + APIKey string + HTTPClient HTTPClient + func NewClient(configs ...func(*Client)) (*Client, error) + func (c *Client) CreateAlertCondition(policyID uint, args *CreateAlertConditionArgs) (*AlertCondition, error) + func (c *Client) CreateMonitor(m *CreateMonitorArgs) (*Monitor, error) + func (c *Client) DeleteAlertCondition(alertConditionID uint) error + func (c *Client) DeleteMonitor(id string) error + func (c *Client) GetAlertCondition(policyID, alertConditionID uint) (*AlertCondition, error) + func (c *Client) GetAllMonitors(offset, limit uint) (*GetAllMonitorsResponse, error) + func (c *Client) GetMonitor(id string) (*Monitor, error) + func (c *Client) GetMonitorScript(id string) (string, error) + func (c *Client) UpdateAlertCondition(alertConditionID uint, args *UpdateAlertConditionArgs) (*AlertCondition, error) + func (c *Client) UpdateMonitor(id string, args *UpdateMonitorArgs) (*Monitor, error) + func (c *Client) UpdateMonitorScript(id string, args *UpdateMonitorScriptArgs) error + type CreateAlertConditionArgs struct + Enabled bool + MonitorID string + Name string + RunbookURL string + type CreateMonitorArgs struct + BypassHEADRequest *bool + Frequency uint + Locations []string + Name string + SLAThreshold float64 + Status string + TreatRedirectAsFailure *bool + Type string + URI string + ValidationString *string + VerifySSL *bool + type ExtendedMonitor struct + APIVersion string + CreatedAt time.Time + CreatedAtRaw string + Frequency uint + ID string + Locations []string + ModifiedAt time.Time + ModifiedAtRaw string + Name string + Options map[string]interface{} + SLAThreshold float64 + Status string + Type string + URI string + UserID uint + type GetAllMonitorsResponse struct + Count uint + Monitors []*ExtendedMonitor + type HTTPClient interface + Do func(*http.Request) (*http.Response, error) + type Monitor struct + APIVersion string + BypassHEADRequest *bool + Frequency uint + ID string + Locations []string + Name string + Options map[string]interface{} + SLAThreshold float64 + Status string + TreatRedirectAsFailure *bool + Type string + URI string + UserID uint + ValidationString *string + VerifySSL *bool + type RetryableHTTPClient interface + Do func(func() (*http.Request, error)) (*http.Response, error) + type ScriptLocation struct + HMAC string + Name string + type UpdateAlertConditionArgs struct + Enabled bool + MonitorID string + Name string + RunbookURL string + type UpdateMonitorArgs struct + BypassHEADRequest *bool + Frequency uint + Locations []string + Name string + SLAThreshold float64 + Status string + TreatRedirectAsFailure *bool + URI string + ValidationString *string + VerifySSL *bool + type UpdateMonitorScriptArgs struct + ScriptLocations []*ScriptLocation + ScriptText string