Documentation ¶
Index ¶
- type CacheControl
- type Error
- func NewMalformedJSONError(err error, uri fmt.Stringer) *Error
- func NewMalformedSubRequestError(err error, uri fmt.Stringer) *Error
- func NewMalformedURLError(err error) *Error
- func NewResponseBodyReadError(err error, uri fmt.Stringer) *Error
- func NewResponseError(resp *http.Response, uri fmt.Stringer) *Error
- func NewRoundTripError(err error, uri fmt.Stringer) *Error
- type Transport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheControl ¶
type CacheControl struct { MustRevalidate bool NoCache bool NoStore bool Public bool Private bool Immutable bool MaxAge *time.Duration }
CacheControl represents a response's cache policy.
func NewCacheControl ¶
func NewCacheControl(resp *http.Response) *CacheControl
NewCacheControl creates a new instance of CacheControl from related headers in the given HTTP response.
func (*CacheControl) Merge ¶
func (c *CacheControl) Merge(o *CacheControl) *CacheControl
Merge merges 2 CacheControls.
func (*CacheControl) String ¶
func (c *CacheControl) String() string
String generates CacheControl header value.
type Error ¶
type Error struct { Type string `json:"type"` Title string `json:"title"` Status int `json:"status,omitempty"` Detail string `json:"detail,omitempty"` Links map[string]interface{} `json:"_links,omitempty"` }
Error represents an embedding error.
func NewMalformedJSONError ¶
NewMalformedJSONError returns an error for an invalid response JSON.
func NewMalformedSubRequestError ¶
NewMalformedSubRequestError returns an error for an invalid sub request.
func NewMalformedURLError ¶
NewMalformedURLError returns an error for an invalid link URI.
func NewResponseBodyReadError ¶
NewResponseBodyReadError returns an error for a failed response body read.
func NewResponseError ¶
NewResponseError returns an error for a non-successful sub request response.
func NewRoundTripError ¶
NewRoundTripError returns an error for a failed sub request round trip.