Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cache ¶
type Cache interface { Empty() error Delete(string) error AddData(string, []byte) error Add(string, *http.Response) error Get(string) (Request, Response, error) Serve(http.ResponseWriter, *http.Request) error }
Cache defines a interface which exposes a cache like structure for retrieving requests.
type Request ¶
type Request struct { Body bytes.Buffer `json:"body"` Method string `json:"method"` Path string `json:"path"` URL *url.URL `json:"url"` Headers map[string]string `json:"headers"` Underline interface{} `json:"underline"` }
Request defines the structure which holds request fields for a given request.
func HTTPRequestToRequest ¶
HTTPRequestToRequest transforms a giving request object into a cache.Request object.
type Response ¶
type Response struct { Status int `json:"status"` Method string `json:"method"` Type string `json:"type"` Body bytes.Buffer `json:"body"` Headers map[string]string `json:"headers"` Cookies []string `json:"cookies"` Underline interface{} `json:"underline"` }
Response defines a struct to hold a response for a giving resource.
Click to show internal directories.
Click to hide internal directories.