Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Request ¶
type Request struct { Defaults *RequestPart Requests []RequestPart }
Request is a batch request.
type RequestPart ¶
type RequestPart struct { Method string `json:"method"` Path string `json:"path"` Body json.RawMessage `json:"body"` Headers map[string]string `json:"headers"` }
RequestPart contains sub-request information of a batch request.
func (*RequestPart) Norm ¶
func (p *RequestPart) Norm(namespace string, defaults *RequestPart)
Norm merges defaults and normalizes part.
type Response ¶
type Response struct {
Responses []ResponsePart `json:"responses"`
}
Response is a batch response.
type ResponsePart ¶
type ResponsePart struct { Status int `json:"status"` Path string `json:"path"` Body json.RawMessage `json:"body,omitempty"` Headers map[string]string `json:"headers,omitempty"` }
ResponsePart contains sub-response information of a batch response.
type ResponseRecorder ¶
type ResponseRecorder struct {
// contains filtered or unexported fields
}
ResponseRecorder records responses.
func (*ResponseRecorder) Header ¶
func (w *ResponseRecorder) Header() http.Header
Header implements http.ResponseWriter interface.
func (*ResponseRecorder) Write ¶
func (w *ResponseRecorder) Write(p []byte) (int, error)
Write implements http.ResponseWriter interface.
func (*ResponseRecorder) WriteHeader ¶
func (w *ResponseRecorder) WriteHeader(code int)
WriteHeader implements http.ResponseWriter interface.
Click to show internal directories.
Click to hide internal directories.