Documentation ¶
Overview ¶
api provides common functionality for all the iron.io APIs
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Debug bool DebugOnErrors bool DefaultCacheSize = 8192 // HttpClient is the client used by iron_go to make each http request. It is exported in case // the client would like to modify it from the default behavior from http.DefaultClient. // This uses the DefaultTransport modified to enable TLS Session Client caching. HttpClient = &http.Client{ Transport: &http.Transport{ Proxy: http.ProxyFromEnvironment, Dial: (&net.Dialer{ Timeout: 30 * time.Second, KeepAlive: 30 * time.Second, }).Dial, MaxIdleConnsPerHost: 512, TLSHandshakeTimeout: 10 * time.Second, TLSClientConfig: &tls.Config{ ClientSessionCache: tls.NewLRUClientSessionCache(DefaultCacheSize), }, }, } )
View Source
var HTTPErrorDescriptions = map[int]string{ http.StatusUnauthorized: "The OAuth token is either not provided or invalid", http.StatusNotFound: "The resource, project, or endpoint being requested doesn't exist.", http.StatusMethodNotAllowed: "This endpoint doesn't support that particular verb", http.StatusNotAcceptable: "Required fields are missing", }
View Source
var MaxRequestRetries = 5
Functions ¶
This section is empty.
Types ¶
type DefaultResponseBody ¶
type DefaultResponseBody struct {
Msg string `json:"msg"`
}
type HTTPResponseError ¶
func ResponseAsError ¶
func ResponseAsError(response *http.Response) HTTPResponseError
type URL ¶
func VersionAction ¶
Click to show internal directories.
Click to hide internal directories.