Documentation ¶
Overview ¶
Package httputil a package for handling http data tasks
Index ¶
- func SupportsProcessing(request *http.Request) bool
- type ResponseWrapper
- func (wrapper *ResponseWrapper) GetBuffer() *bytes.Buffer
- func (wrapper *ResponseWrapper) GetContent() ([]byte, error)
- func (wrapper *ResponseWrapper) GetContentEncoding() string
- func (wrapper *ResponseWrapper) GetContentType() string
- func (wrapper *ResponseWrapper) SetContent(data []byte)
- func (wrapper *ResponseWrapper) SetLastModified(value bool)
- func (wrapper *ResponseWrapper) SupportsProcessing() bool
- func (wrapper *ResponseWrapper) Write(data []byte) (int, error)
- func (wrapper *ResponseWrapper) WriteHeader(statusCode int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SupportsProcessing ¶
SupportsProcessing determine if http.Request is supported by this plugin.
Types ¶
type ResponseWrapper ¶
type ResponseWrapper struct { http.ResponseWriter // contains filtered or unexported fields }
ResponseWrapper a wrapper used to simplify ResponseWriter data access and manipulation.
func (*ResponseWrapper) GetBuffer ¶
func (wrapper *ResponseWrapper) GetBuffer() *bytes.Buffer
GetBuffer get a pointer to the ResponseWriter buffer.
func (*ResponseWrapper) GetContent ¶
func (wrapper *ResponseWrapper) GetContent() ([]byte, error)
GetContent load the content currently in the internal buffer accounting for possible encoding.
func (*ResponseWrapper) GetContentEncoding ¶
func (wrapper *ResponseWrapper) GetContentEncoding() string
GetContentEncoding get the Content-Encoding header value.
func (*ResponseWrapper) GetContentType ¶
func (wrapper *ResponseWrapper) GetContentType() string
GetContentType get the Content-Encoding header value.
func (*ResponseWrapper) SetContent ¶
func (wrapper *ResponseWrapper) SetContent(data []byte)
SetContent write data to the internal ResponseWriter buffer and match initial encoding.
func (*ResponseWrapper) SetLastModified ¶
func (wrapper *ResponseWrapper) SetLastModified(value bool)
SetLastModified update the local lastModified variable from non-package-based users.
func (*ResponseWrapper) SupportsProcessing ¶
func (wrapper *ResponseWrapper) SupportsProcessing() bool
SupportsProcessing determine if HttpWrapper is supported by this plugin based on encoding.
func (*ResponseWrapper) Write ¶
func (wrapper *ResponseWrapper) Write(data []byte) (int, error)
Write data to internal buffer and mark the status code as http.StatusOK.
func (*ResponseWrapper) WriteHeader ¶
func (wrapper *ResponseWrapper) WriteHeader(statusCode int)
WriteHeader into wrapped ResponseWriter.