Documentation
¶
Index ¶
Constants ¶
const ( LANG_RU = "ru" LANG_EN = "en" )
const ( REGION_ALL = "all" REGION_RU = "ru" REGION_KZ = "kz" )
const ( ZONE_RU_A = "ru-central1-a" ZONE_RU_B = "ru-central1-b" ZONE_RU_C = "ru-central1-c" ZONE_RU_D = "ru-central1-d" ZONE_KZ_A = "kz1-a" )
const ( STATUS_OPEN = "open" STATUS_RESOLVED = "resolved" STATUS_WITH_REPORT = "withReport" )
const ( TYPE_INVESTIGATION = "investigation" TYPE_UPDATE = "update" TYPE_RESOLVED = "resolved" )
const ( LEVEL_MINOR = "Minor" // 1 LEVEL_UNAVAILABLE = "Unavailable" // 2 )
const ( LEVEL_ID_MINOR uint8 = 1 LEVEL_ID_UNAVAILABLE uint8 = 2 )
const UA = "EK|YCS.go"
UA is HTTP client user-agent
Variables ¶
var AllLangs = []string{LANG_EN, LANG_RU}
AllLangs is a slice with all supported languages
var AllRegions = []string{REGION_ALL, REGION_KZ, REGION_RU}
AllRegions is a slice with all regions
AllZones is a slice with all availability zones
Functions ¶
func SetLimit ¶
func SetLimit(rps float64)
SetLimit sets a hard limit on the number of requests per second
func SetRequestTimeout ¶
func SetRequestTimeout(timeout float64)
SetRequestTimeout sets request timeout
Types ¶
type Comment ¶
type Incident ¶
type Incident struct {
ID uint `json:"id"`
Title string `json:"title"`
Report string `json:"report,omitempty"`
Status string `json:"status"`
IsReportPublished bool `json:"isReportPublished,omitempty"`
LevelID uint8 `json:"levelId"`
StartDate Date `json:"startDate"`
EndDate Date `json:"endDate"`
CreatedAt Date `json:"createdAt"`
UpdatedAt Date `json:"updatedAt"`
ReportPublishedTime Date `json:"reportPublishedTime"`
Level *Level `json:"level"`
Zones Zones `json:"zones"`
Regions Regions `json:"installations"`
Services Services `json:"services"`
Comments Comments `json:"comments"`
}
Incident contains info about incident
func GetIncident ¶
GetIncidents returns slice with incidents
func (*Incident) IsResolved ¶
IsResolved returns true if incident is resolved
func (*Incident) RegionList ¶
RegionList returns slice with all regions affected by the incident
func (*Incident) ReportMarkdown ¶
ReportMarkdown converts report HTML to Markdown
func (*Incident) ServiceList ¶
ServiceList returns slice with all services affected by the incident
type Incidents ¶
type Incidents []*Incident
Incidents is a slice with incidents
func GetIncidents ¶
func GetIncidents(req IncidentsRequest) (Incidents, error)
GetIncidents returns slice with incidents
type IncidentsRequest ¶
type IncidentsRequest struct {
Lang string
From time.Time
To time.Time
Status string
Region string
Zones []string
}
IncidentsRequest contains incident request info
type Level ¶
type Level struct {
Level uint8 `json:"level"`
Label string `json:"label"`
Theme string `json:"theme"`
CreatedAt Date `json:"createdAt"`
UpdatedAt Date `json:"updatedAt"`
}
Level contains info about incident level
type Service ¶
type Service struct {
Name string `json:"name"`
FullName string `json:"fullName"`
Slug string `json:"slug"`
Description string `json:"description"`
IAMFlag string `json:"iamFlag,omitempty"`
Status string `json:"status"`
DocURL string `json:"docUrl"`
PricesURL string `json:"pricesUrl"`
ConsoleURL string `json:"consoleUrl"`
InstallationCode string `json:"installationCode"`
Icon string `json:"icon"`
IconName string `json:"iconName"`
OrderNumber uint `json:"orderNumber"`
CategoryID uint `json:"categoryId"`
ID uint `json:"id"`
PageID uint `json:"pageId"`
CreatedAt Date `json:"createdAt"`
UpdatedAt Date `json:"updatedAt"`
IsProduct bool `json:"isProduct"`
Incidents Incidents `json:"incidents"`
}
Service contains info about service
type Services ¶
type Services []*Service
Services is slice with services
func GetServices ¶
GetServices returns status of all services