Documentation ¶
Overview ¶
Package api contains the common code shared by all Azure API libraries.
Index ¶
Constants ¶
View Source
const AzureTimeFormat = "2006-01-02T15:04:05Z"
Variables ¶
This section is empty.
Functions ¶
func CheckResponse ¶
CheckResponse returns an error (of type *Error) if the response status code is not 2xx.
func ExpandURL ¶
ExpandURL subsitutes any {{encoded}} strings in the URL passed in using the map supplied.
func RandBetween ¶ added in v1.4.3
func ResolveRelative ¶
ResolveRelative combines a url base with a relative path.
Types ¶
type Error ¶
type Error struct { // StatusCode is the HTTP response status code and will always be populated. StatusCode int `json:"statusCode"` // Code is the API error code that is given in the error message. Code string `json:"code"` // Message is the server response message and is only populated when // explicitly referenced by the JSON server response. Message string `json:"message"` // Body is the raw response returned by the server. // It is often but not always JSON, depending on how the request fails. Body string // Header contains the response header fields from the server. Header http.Header // URL is the URL of the original HTTP request and will always be populated. URL string }
Error contains an error response from the server.
type JSONTime ¶
JSONTime assumes the time format is RFC3339.
func (JSONTime) MarshalJSON ¶
MarshalJSON ensures that the time is serialized as RFC3339.
func (*JSONTime) UnmarshalJSON ¶
UnmarshalJSON ensures that the time is deserialized as RFC3339.
type ResponseMetadata ¶
type ResponseMetadata struct { // HTTPStatusCode is the server's response status code. HTTPStatusCode int // Header contains the response header fields from the server. Header http.Header }
ResponseMetadata is embedded in each response and contains the HTTP response code and headers from the server.
Click to show internal directories.
Click to hide internal directories.