Documentation
¶
Index ¶
- Constants
- func WithHTTPClient(client *Client, c HTTPClient) error
- type Client
- func (c *Client) CreateHistoricIncident(name, message string, date time.Time) (*Incident, error)
- func (c *Client) CreateIncident(component, name, message, status string, componentIDs []string) (*Incident, error)
- func (c *Client) CreateSubscriber(email string) (*Subscriber, error)
- func (c *Client) DeleteIncident(incident *Incident) (*Incident, error)
- func (c *Client) DeleteSubscriber(subscriber *Subscriber) (*Subscriber, error)
- func (c *Client) GetAllComponents() ([]Component, error)
- func (c *Client) GetAllIncidents() ([]Incident, error)
- func (c *Client) GetAllSubscribers() ([]Subscriber, error)
- func (c *Client) GetComponentByID(id string) (*Component, error)
- func (c *Client) GetComponentByName(name string) (*Component, error)
- func (c *Client) GetComponentGroups() ([]ComponentGroup, error)
- func (c *Client) GetIncident(incidentID string) (*Incident, error)
- func (c *Client) GetOpenIncidents() ([]Incident, error)
- func (c *Client) GetScheduledIncidents() ([]Incident, error)
- func (c *Client) ScheduleIncident(component, name, message string, start, end time.Time, ...) (*Incident, error)
- func (c *Client) UpdateComponentDesc(comp *Component) (*Component, error)
- func (c *Client) UpdateComponentName(comp *Component) (*Component, error)
- func (c *Client) UpdateComponentStatus(comp *Component) (*Component, error)
- func (c *Client) UpdateIncident(incident *Incident, name, status, message string) (*Incident, error)
- type Component
- type ComponentGroup
- type ComponentStatus
- type ComponentUpdateData
- type ComponentsResponse
- type HTTPClient
- type HistoricIncident
- type Incident
- type IncidentAffectedComponent
- type IncidentResponse
- type IncidentUpdate
- type NewIncident
- type NewIncidentUpdate
- type NewSubscriber
- type ScheduledIncident
- type Subscriber
- type SubscriberResponse
Constants ¶
View Source
const DefaultAPIURL = "https://api.statuspage.io/v1/pages/"
Variables ¶
This section is empty.
Functions ¶
func WithHTTPClient ¶ added in v0.4.0
func WithHTTPClient(client *Client, c HTTPClient) error
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CreateHistoricIncident ¶
func (*Client) CreateIncident ¶
func (*Client) CreateSubscriber ¶
func (c *Client) CreateSubscriber(email string) (*Subscriber, error)
func (*Client) DeleteIncident ¶
func (*Client) DeleteSubscriber ¶
func (c *Client) DeleteSubscriber(subscriber *Subscriber) (*Subscriber, error)
func (*Client) GetAllComponents ¶
func (*Client) GetAllIncidents ¶
func (*Client) GetAllSubscribers ¶
func (c *Client) GetAllSubscribers() ([]Subscriber, error)
func (*Client) GetComponentByName ¶
func (*Client) GetComponentGroups ¶ added in v0.2.0
func (c *Client) GetComponentGroups() ([]ComponentGroup, error)
func (*Client) GetIncident ¶ added in v0.3.1
func (*Client) GetOpenIncidents ¶
func (*Client) GetScheduledIncidents ¶
func (*Client) ScheduleIncident ¶
func (*Client) UpdateComponentDesc ¶
func (*Client) UpdateComponentName ¶
func (*Client) UpdateComponentStatus ¶
func (*Client) UpdateIncident ¶
func (c *Client) UpdateIncident(incident *Incident, name, status, message string) (*Incident, error)
UpdateIncident updates an incident. If Status and/or Message are different, a new update will be published for the incident. Each change will add an update notification, so updates should be batched.
type Component ¶
type Component struct {
CreatedAt *time.Time `json:"created_at,omitempty"`
Description *string `json:"description,omitempty"`
Group bool `json:"group,omitempty"`
GroupID *string `json:"group_id,omitempty"`
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
PageID *string `json:"page_id,omitempty"`
Position *int `json:"position,omitempty"`
Status *string `json:"status,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
}
type ComponentGroup ¶ added in v0.2.0
type ComponentGroup struct {
Components *[]string `json:"components,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
PageID *string `json:"page_id,omitempty"`
Position *int `json:"position,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
}
type ComponentStatus ¶
type ComponentStatus int
const ( Operational ComponentStatus = iota DegradedPerformance PartialOutage MajorOutage )
func (ComponentStatus) String ¶
func (i ComponentStatus) String() string
func (ComponentStatus) ToLower ¶
func (i ComponentStatus) ToLower() string
type ComponentUpdateData ¶
type ComponentUpdateData struct {
Data string
}
func (*ComponentUpdateData) String ¶
func (c *ComponentUpdateData) String() string
type ComponentsResponse ¶
type ComponentsResponse []Component
type HTTPClient ¶ added in v0.4.0
type HistoricIncident ¶
func (*HistoricIncident) String ¶
func (i *HistoricIncident) String() string
type Incident ¶
type Incident struct {
Backfilled *bool `json:"backfilled,omitempty"`
Components *[]Component `json:"components,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
ID *string `json:"id,omitempty"`
Impact *string `json:"impact,omitempty"`
ImpactOverride *string `json:"impact_override,omitempty"`
IncidentUpdates []*IncidentUpdate `json:"incident_updates,omitempty"`
MonitoringAt *time.Time `json:"monitoring_at,omitempty"`
Name *string `json:"name,omitempty"`
PageID *string `json:"page_id,omitempty"`
PostmortemBody *string `json:"postmortem_body,omitempty"`
PostmortemBodyLastUpdatedAt *time.Time `json:"postmortem_body_last_updated_at,omitempty"`
PostmortemIgnored *bool `json:"postmortem_ignored,omitempty"`
PostmortemNotifiedSubscribers *bool `json:"postmortem_notified_subscribers,omitempty"`
PostmortemNotifiedTwitter *bool `json:"postmortem_notified_twitter,omitempty"`
PostmortemPublishedAt *time.Time `json:"postmorem_published_at,omitempty"`
ResolvedAt *time.Time `json:"resolved_at,omitempty"`
ScheduledAutoInProgress *bool `json:"scheduled_auto_in_progress,omitempty"`
ScheduledAutoCompleted *bool `json:"scheduled_auto_completed,omitempty"`
ScheduledFor *time.Time `json:"scheduled_for"`
ScheduledRemindPrior *bool `json:"scheduled_remind_prior,omitempty"`
ScheduledRemindedAt *time.Time `json:"scheduled_reminded_at,omitempty"`
ScheduledUntil *time.Time `json:"scheduled_until,omitempty"`
Shortlink *string `json:shortlink,omitempty"`
Status *string `json:status,omitempty"`
UpdatedAt *time.Time `json:updated_at,omitempty"`
}
type IncidentResponse ¶
type IncidentResponse []Incident
type IncidentUpdate ¶
type IncidentUpdate struct {
AffectedComponents *[]IncidentAffectedComponent `json:"affected_components,omitempty"`
Body *string `json:"body,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
CustomTweet *string `json:"custom_tweet,omitempty"`
DeliverNotifications *bool `json:"deliver_notifications,omitempty"`
DisplayAt *time.Time `json:"display_at,omitempty"`
ID *string `json:"id,omitempty"`
IncidentID *string `json:"incident_id,omitempty"`
Status *string `json:"status,omitempty"`
TweetID *string `json:"tweet_id,omitempty"`
TwitterUpdatedAt *time.Time `json:"twitter_updated_at,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
WantsTwitterUpdate *bool `json:"wants_twitter-update,omitempty"`
}
type NewIncident ¶
type NewIncident struct {
Name string
Status string
Message string
WantsTwitterUpdate bool
ImpactOverride string
ComponentIDs []string
}
func (*NewIncident) String ¶
func (i *NewIncident) String() string
type NewIncidentUpdate ¶
type NewIncidentUpdate struct {
Name string
Status string
Message string
WantsTwitterUpdate bool
ImpactOverride string
ComponentIDs []string
}
func (*NewIncidentUpdate) String ¶
func (i *NewIncidentUpdate) String() string
type NewSubscriber ¶
type NewSubscriber struct {
Email string `json:"email,omitempty"`
}
func (*NewSubscriber) String ¶
func (s *NewSubscriber) String() string
type ScheduledIncident ¶
type ScheduledIncident struct {
Name string
Status string
ScheduledFor time.Time
ScheduledUntil time.Time
WantsTwitterUpdate bool
ScheduledRemindPrior bool
ScheduledAutoInProgress bool
ScheduledAutoCompleted bool
ImpactOverride string
Message string
ComponentIDs []string
}
func (*ScheduledIncident) String ¶
func (i *ScheduledIncident) String() string
type Subscriber ¶
type Subscriber struct {
ID *string `json:"id,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
PhoneCountry *string `json:"phone_country,omitempty"`
PhoneNumber *string `json:"phone_number,omitempty"`
Email *string `json:"email,omitempty"`
SkipNotify *bool `json:"skip_confirmation_notification,omitempty"`
Mode *string `json:"mode,omitempty"`
QuarantinedAt *time.Time `json:"quarantined_at,omitempty"`
PurgeAt *time.Time `json:"purge_at,omitempty"`
Components []*Component `json:"components,omitempty"`
}
func (*Subscriber) String ¶
func (s *Subscriber) String() string
type SubscriberResponse ¶
type SubscriberResponse []Subscriber
Click to show internal directories.
Click to hide internal directories.