Documentation ¶
Index ¶
- func Stringify(message interface{}) string
- type Client
- type Component
- type ComponentService
- func (s *ComponentService) DeleteComponent(ctx context.Context, pageID string, componentID string) error
- func (s *ComponentService) GetComponent(ctx context.Context, pageID string, componentID string) (*Component, error)
- func (s *ComponentService) ListComponents(ctx context.Context, pageID string) (*[]Component, error)
- func (s *ComponentService) UpdateComponent(ctx context.Context, pageID string, componentID string, ...) (*Component, error)
- type Page
- type PageLogo
- type PageService
- type Timestamp
- type UpdateComponentParams
- type UpdateComponentRequestBody
- type UpdatePageParams
- type UpdatePageRequestBody
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct { // Base URL for API requests. Defaults to the public Statuspage API. BaseURL *url.URL UserAgent string Token string Version string // Services used for talking to different parts of the Statuspage API. Page *PageService Component *ComponentService // contains filtered or unexported fields }
A Client manages communication with the Statuspage API.
type Component ¶
type Component struct { ID *string `json:"id,omitempty"` PageID *string `json:"page_id,omitempty"` GroupID *string `json:"group_id,omitempty"` CreatedAt *Timestamp `json:"created_at,omitempty"` UpdatedAt *Timestamp `json:"updated_at,omitempty"` Group *bool `json:"group,omitempty"` Name *string `json:"name,omitempty"` Description *string `json:"description,omitempty"` Position *int32 `json:"position,omitempty"` Status *string `json:"status,omitempty"` Showcase *bool `json:"showcase,omitempty"` OnlyShowIfDegraded *bool `json:"only_show_if_degraded,omitempty"` AutomationEmail *string `json:"automation_email,omitempty"` }
Component is the Statuspage API component representation
type ComponentService ¶
type ComponentService service
ComponentService handles communication with the page related methods of the Statuspage API.
Statuspage API docs: https://developer.statuspage.io/#tag/pages
func (*ComponentService) DeleteComponent ¶
func (s *ComponentService) DeleteComponent(ctx context.Context, pageID string, componentID string) error
DeleteComponent deletes a component for a given page and component id
func (*ComponentService) GetComponent ¶
func (s *ComponentService) GetComponent(ctx context.Context, pageID string, componentID string) (*Component, error)
GetComponent returns component information for a given page and component id
func (*ComponentService) ListComponents ¶
ListComponents returns a list of all components for a given page id
func (*ComponentService) UpdateComponent ¶
func (s *ComponentService) UpdateComponent(ctx context.Context, pageID string, componentID string, component UpdateComponentParams) (*Component, error)
UpdateComponent updates a component for a given page and component id
type Page ¶
type Page struct { ID *string `json:"id,omitempty"` CreatedAt *Timestamp `json:"created_at,omitempty"` UpdatedAt *Timestamp `json:"updated_at,omitempty"` Name *string `json:"name,omitempty"` PageDescription *string `json:"page_description,omitempty"` Headline *string `json:"headline,omitempty"` Branding *string `json:"branding,omitempty"` Subdomain *string `json:"subdomain,omitempty"` Domain *string `json:"domain,omitempty"` URL *string `json:"url,omitempty"` SupportURL *string `json:"support_url,omitempty"` HiddenFromSearch *bool `json:"hidden_from_search,omitempty"` AllowPageSubscribers *bool `json:"allow_page_subscribers,omitempty"` AllowIncidentSubscribers *bool `json:"allow_incident_subscribers,omitempty"` AllowEmailSubscribers *bool `json:"allow_email_subscribers,omitempty"` AllowSmsSubscribers *bool `json:"allow_sms_subscribers,omitempty"` AllowRssAtomFeeds *bool `json:"allow_rss_atom_feeds,omitempty"` AllowWebhookSubscribers *bool `json:"allow_webhook_subscribers,omitempty"` NotificationsFromEmail *string `json:"notifications_from_email,omitempty"` ActivityScore *int64 `json:"activity_score,omitempty"` TwitterUsername *string `json:"twitter_username,omitempty"` ViewersMustBeTeamMembers *bool `json:"viewers_must_be_team_members,omitempty"` IPRestrictions *string `json:"ip_restrictions,omitempty"` City *string `json:"city,omitempty"` State *string `json:"state,omitempty"` Country *string `json:"country,omitempty"` TimeZone *string `json:"time_zone,omitempty"` CSSBodyBackgroundColor *string `json:"css_body_background_color,omitempty"` CSSFontColor *string `json:"css_font_color,omitempty"` CSSLightFontColor *string `json:"css_light_font_color,omitempty"` CSSGreens *string `json:"css_greens,omitempty"` CSSYellows *string `json:"css_yellows,omitempty"` CSSOranges *string `json:"css_oranges,omitempty"` CSSReds *string `json:"css_reds,omitempty"` CSSBlues *string `json:"css_blues,omitempty"` CSSBorderColor *string `json:"css_border_color,omitempty"` CSSGraphColor *string `json:"css_graph_color,omitempty"` CSSLinkColor *string `json:"css_link_color,omitempty"` FaviconLogo *PageLogo `json:"favicon_logo,omitempty"` TransactionalLogo *PageLogo `json:"transactional_logo,omitempty"` HeroCover *PageLogo `json:"hero_cover,omitempty"` EmailLogo *PageLogo `json:"email_logo,omitempty"` TwitterLogo *PageLogo `json:"twitter_logo,omitempty"` }
Page is the Statuspage API page representation
type PageLogo ¶
type PageLogo struct { UpdatedAt *Timestamp `json:"updated_at,omitempty"` Size *int64 `json:"size,omitempty"` URL *string `json:"url,omitempty"` }
PageLogo is the Statuspage API page logo representation
type PageService ¶
type PageService service
PageService handles communication with the page related methods of the Statuspage API.
Statuspage API docs: https://developer.statuspage.io/#tag/pages
func (*PageService) ListPages ¶
func (s *PageService) ListPages(ctx context.Context) (*[]Page, error)
ListPages returns a list of all pages
func (*PageService) UpdatePage ¶
func (s *PageService) UpdatePage(ctx context.Context, pageID string, page UpdatePageParams) (*Page, error)
UpdatePage updates page information for a given page id
type Timestamp ¶
Timestamp represents a time that can be unmarshalled from a JSON string formatted as either an RFC3339 or Unix timestamp.
func (*Timestamp) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface. Time is expected in RFC3339 or Unix format.
type UpdateComponentParams ¶
type UpdateComponentParams struct { Description string `json:"description,omitempty"` Status string `json:"status,omitempty"` Name string `json:"name,omitempty"` OnlyShowIfDegraded bool `json:"only_show_if_degraded,omitempty"` GroupID string `json:"group_id,omitempty"` Showcase bool `json:"showcase,omitempty"` StartDate Timestamp `json:"start_date,omitempty"` }
UpdateComponentParams are the parameters that can be changed using the update component API endpoint
type UpdateComponentRequestBody ¶
type UpdateComponentRequestBody struct {
Component UpdateComponentParams `json:"component"`
}
UpdateComponentRequestBody is the update component request body representation
type UpdatePageParams ¶
type UpdatePageParams struct { Name string `json:"name,omitempty"` Domain string `json:"domain,omitempty"` Subdomain string `json:"subdomain,omitempty"` URL string `json:"url,omitempty"` Branding string `json:"branding,omitempty"` CSSBodyBackgroundColor string `json:"css_body_background_color,omitempty"` CSSFontColor string `json:"css_font_color,omitempty"` CSSLightFontColor string `json:"css_light_font_color,omitempty"` CSSGreens string `json:"css_greens,omitempty"` CSSYellows string `json:"css_yellows,omitempty"` CSSOranges string `json:"css_oranges,omitempty"` CSSReds string `json:"css_reds,omitempty"` CSSBlues string `json:"css_blues,omitempty"` CSSBorderColor string `json:"css_border_color,omitempty"` CSSGraphColor string `json:"css_graph_color,omitempty"` CSSLinkColor string `json:"css_link_color,omitempty"` HiddenFromSearch *bool `json:"hidden_from_search,omitempty"` ViewersMustBeTeamMembers *bool `json:"viewers_must_be_team_members,omitempty"` AllowPageSubscribers *bool `json:"allow_page_subscribers,omitempty"` AllowIncidentSubscribers *bool `json:"allow_incident_subscribers,omitempty"` AllowEmailSubscribers *bool `json:"allow_email_subscribers,omitempty"` AllowSmsSubscribers *bool `json:"allow_sms_subscribers,omitempty"` AllowRssAtomFeeds *bool `json:"allow_rss_atom_feeds,omitempty"` AllowWebhookSubscribers *bool `json:"allow_webhook_subscribers,omitempty"` NotificationsFromEmail string `json:"notifications_from_email,omitempty"` TimeZone string `json:"time_zone,omitempty"` }
UpdatePageParams are the parameters that can be changed using the update page API endpoint
type UpdatePageRequestBody ¶
type UpdatePageRequestBody struct {
Page UpdatePageParams `json:"page"`
}
UpdatePageRequestBody is the update page request body representation