Documentation
¶
Overview ¶
Package http provides the JSON-serializable model, mapper, and option decoder for the HTTP layer. It registers itself with the jsonapi registry via init().
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeOptions ¶
func DecodeOptions(raw json.RawMessage) ([]greet.GreetOption, error)
DecodeOptions decodes raw HTTP options into engine GreetOptions.
func FromResult ¶
FromResult maps a *greethttp.HTTPResult to *Data.
Types ¶
type Data ¶
type Data struct {
ProtocolVersion string `json:"protocolVersion"`
StatusCode int `json:"statusCode"`
Status string `json:"status"`
ResponseHeaders []Header `json:"responseHeaders,omitempty"`
Redirects []RedirectHop `json:"redirects,omitempty"`
}
Data is the JSON-serializable payload for an HTTP layer. The response body is intentionally omitted from the JSON API.
type Options ¶
type Options struct {
Target string `json:"target,omitempty"`
Method string `json:"method,omitempty"`
Headers []Header `json:"headers,omitempty"`
MaxResponseBodyBytes int64 `json:"maxResponseBodyBytes,omitempty"`
MaxRedirectFollow int `json:"maxRedirectFollow,omitempty"`
}
Options holds JSON-serializable HTTP layer options.
Click to show internal directories.
Click to hide internal directories.