NewObjectError creates a new Reader with a custom status code
(statusCode int, message string)
| 59 | |
| 60 | // NewObjectError creates a new Reader with a custom status code |
| 61 | func NewObjectError(statusCode int, message string) *ObjectReader { |
| 62 | return &ObjectReader{ |
| 63 | Status: statusCode, |
| 64 | Body: io.NopCloser(strings.NewReader(message)), |
| 65 | Headers: http.Header{httpheaders.ContentType: {"text/plain"}}, |
| 66 | contentLength: int64(len(message)), |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | // NewObjectNotModified creates a new Reader with a 304 Not Modified status. |
| 71 | func NewObjectNotModified(headers http.Header) *ObjectReader { |
no outgoing calls
no test coverage detected