(filename string)
| 189 | } |
| 190 | |
| 191 | func FileResponse(filename string) Responder { |
| 192 | return func(req *http.Request) (*http.Response, error) { |
| 193 | f, err := os.Open(filename) |
| 194 | if err != nil { |
| 195 | return nil, err |
| 196 | } |
| 197 | return httpResponse(200, req, f), nil |
| 198 | } |
| 199 | } |
| 200 | |
| 201 | func RESTPayload(responseStatus int, responseBody string, cb func(payload map[string]interface{})) Responder { |
| 202 | return func(req *http.Request) (*http.Response, error) { |