import "github.com/KnutZuidema/golio/api"
Package api contains constant values for regions and error values for known error return codes from the various APIs
const ( RegionBrasil Region = "br1" RegionEuropeNorthEast = "eun1" RegionEuropeWest = "euw1" RegionJapan = "jp1" RegionKorea = "kr" RegionLatinAmericaNorth = "la1" RegionLatinAmericaSouth = "la2" RegionNorthAmerica = "na1" RegionOceania = "oc1" RegionTurkey = "tr1" RegionRussia = "ru" RegionPBE = "pbe1" )
All existing regions
var ( ErrBadRequest = Error{ Message: "bad request", StatusCode: http.StatusBadRequest, } = Error{ Message: "unauthorized", StatusCode: http.StatusUnauthorized, } ErrForbidden = Error{ Message: "forbidden", StatusCode: http.StatusForbidden, } ErrNotFound = Error{ Message: "not found", StatusCode: http.StatusNotFound, } ErrMethodNotAllowed = Error{ Message: "method not allowed", StatusCode: http.StatusMethodNotAllowed, } ErrUnsupportedMediaType = Error{ Message: "unsupported media type", StatusCode: http.StatusUnsupportedMediaType, } ErrRateLimitExceeded = Error{ Message: "rate limit exceeded", StatusCode: http.StatusTooManyRequests, } ErrInternalServerError = Error{ Message: "internal server error", StatusCode: http.StatusInternalServerError, } ErrBadGateway = Error{ Message: "bad gateway", StatusCode: http.StatusBadGateway, } = Error{ Message: "service unavailable", StatusCode: http.StatusServiceUnavailable, } ErrGatewayTimeout = Error{ Message: "gateway timeout", StatusCode: http.StatusGatewayTimeout, } StatusToError = map[int]Error{ http.StatusBadRequest: ErrBadRequest, http.StatusUnauthorized: ErrUnauthorized, http.StatusForbidden: ErrForbidden, http.StatusNotFound: ErrNotFound, http.StatusMethodNotAllowed: ErrMethodNotAllowed, http.StatusUnsupportedMediaType: ErrUnsupportedMediaType, http.StatusTooManyRequests: ErrRateLimitExceeded, http.StatusInternalServerError: ErrInternalServerError, http.StatusBadGateway: ErrBadGateway, http.StatusServiceUnavailable: ErrServiceUnavailable, http.StatusGatewayTimeout: ErrGatewayTimeout, } )
All regularly returned errors by the Riot API
var ( // Regions is a list of all available regions Regions = []Region{ RegionBrasil, RegionEuropeNorthEast, RegionEuropeWest, RegionJapan, RegionKorea, RegionLatinAmericaNorth, RegionLatinAmericaSouth, RegionNorthAmerica, RegionOceania, RegionTurkey, RegionRussia, RegionPBE, } )
Error is a custom error type used by the API to signal http error responses
Region represents a server region
Package api imports 1 packages (graph) and is imported by 5 packages. Updated 2020-03-19. Refresh now. Tools for package owners.