Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrDisallowedIP = errors.New("disallowed IP")
Functions ¶
func NewRestrictedClient ¶
NewRestrictedClient returns a secure HTTP Client (queries to certain local addresses are blocked)
func NewUnrestrictedClient ¶
NewUnrestrictedClient returns a HTTP Client with no Transport restrictions
Types ¶
type Request ¶
type Request struct {
Client Client
Request *http.Request
Config RequestConfig
Logger logger.Logger
}
Request holds the request and config struct for a http request
func (*Request) SendRequest ¶
func (h *Request) SendRequest() (responseBody []byte, statusCode int, headers http.Header, err error)
SendRequest sends a Request, returns a body, status code, and error.
func (*Request) SendRequestReader ¶
func (h *Request) SendRequestReader() (responseBody io.ReadCloser, statusCode int, headers http.Header, err error)
SendRequestReader allows for streaming the body directly and does not read it all into memory
CALLER IS RESPONSIBLE FOR CLOSING RETURNED RESPONSE BODY
type RequestConfig ¶
type RequestConfig struct {
// SizeLimit in bytes
SizeLimit int64
}
RequestConfig holds the configurable settings for a http request
Click to show internal directories.
Click to hide internal directories.