Documentation ¶
Overview ¶
Package proxyutil provides functionality for building proxies.
Index ¶
- func GetPrettyErrorRsp(msg string) string
- func GetRangeStart(res *http.Response) int64
- func NewResponse(code int, body io.Reader, req *http.Request) *http.Response
- func NewResponseFromOldResponse(code int, body io.Reader, req *http.Request, oldRsp *http.Response) *http.Response
- func Warning(header http.Header, err error)
- type Header
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPrettyErrorRsp ¶ added in v1.3.0
func GetRangeStart ¶
GetRangeStart returns the byte index of the start of the range, if it has one. Returns 0 if the range header is absent, and -1 if the range header is invalid or has multi-part ranges.
func NewResponse ¶
NewResponse builds new HTTP responses. If body is nil, an empty byte.Buffer will be provided to be consistent with the guarantees provided by http.Transport and http.Client.
func NewResponseFromOldResponse ¶ added in v1.3.0
Types ¶
type Header ¶
type Header struct {
// contains filtered or unexported fields
}
Header is a generic representation of a set of HTTP headers for requests and responses.
func RequestHeader ¶
RequestHeader returns a new set of headers from a request.
func ResponseHeader ¶
ResponseHeader returns a new set of headers from a request.
func (*Header) Add ¶
Add appends the value to the existing header at name for the request or response.
func (*Header) All ¶
All returns all the values for header name. If the header does not exist it returns nil, false.