Documentation
¶
Overview ¶
Wrapper around http.Request with additional features
Index ¶
- type Attempt
- type BaseAttempt
- type BaseRequest
- func (br *BaseRequest) AddAttempt(a Attempt)
- func (br *BaseRequest) DeleteUserData(key string)
- func (br *BaseRequest) GetAttempts() []Attempt
- func (br *BaseRequest) GetBody() netutils.MultiReader
- func (br *BaseRequest) GetHttpRequest() *http.Request
- func (br *BaseRequest) GetId() int64
- func (br *BaseRequest) GetLastAttempt() Attempt
- func (br *BaseRequest) GetUserData(key string) (i interface{}, b bool)
- func (br *BaseRequest) SetBody(b netutils.MultiReader)
- func (br *BaseRequest) SetHttpRequest(r *http.Request)
- func (br *BaseRequest) SetUserData(key string, baton interface{})
- func (br *BaseRequest) String() string
- type Request
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseAttempt ¶
type BaseAttempt struct {
Error error
Duration time.Duration
Response *http.Response
Endpoint endpoint.Endpoint
}
func (*BaseAttempt) GetDuration ¶
func (ba *BaseAttempt) GetDuration() time.Duration
func (*BaseAttempt) GetEndpoint ¶
func (ba *BaseAttempt) GetEndpoint() endpoint.Endpoint
func (*BaseAttempt) GetError ¶
func (ba *BaseAttempt) GetError() error
func (*BaseAttempt) GetResponse ¶
func (ba *BaseAttempt) GetResponse() *http.Response
type BaseRequest ¶
type BaseRequest struct {
HttpRequest *http.Request
Id int64
Body netutils.MultiReader
Attempts []Attempt
// contains filtered or unexported fields
}
func NewBaseRequest ¶
func NewBaseRequest(r *http.Request, id int64, body netutils.MultiReader) *BaseRequest
func (*BaseRequest) AddAttempt ¶
func (br *BaseRequest) AddAttempt(a Attempt)
func (*BaseRequest) DeleteUserData ¶
func (br *BaseRequest) DeleteUserData(key string)
func (*BaseRequest) GetAttempts ¶
func (br *BaseRequest) GetAttempts() []Attempt
func (*BaseRequest) GetBody ¶
func (br *BaseRequest) GetBody() netutils.MultiReader
func (*BaseRequest) GetHttpRequest ¶
func (br *BaseRequest) GetHttpRequest() *http.Request
func (*BaseRequest) GetId ¶
func (br *BaseRequest) GetId() int64
func (*BaseRequest) GetLastAttempt ¶
func (br *BaseRequest) GetLastAttempt() Attempt
func (*BaseRequest) GetUserData ¶
func (br *BaseRequest) GetUserData(key string) (i interface{}, b bool)
func (*BaseRequest) SetBody ¶
func (br *BaseRequest) SetBody(b netutils.MultiReader)
func (*BaseRequest) SetHttpRequest ¶
func (br *BaseRequest) SetHttpRequest(r *http.Request)
func (*BaseRequest) SetUserData ¶
func (br *BaseRequest) SetUserData(key string, baton interface{})
func (*BaseRequest) String ¶
func (br *BaseRequest) String() string
type Request ¶
type Request interface {
GetHttpRequest() *http.Request // Original http request
SetHttpRequest(*http.Request) // Can be used to set http request
GetId() int64 // Request id that is unique to this running process
SetBody(netutils.MultiReader) // Sets request body
GetBody() netutils.MultiReader // Request body fully read and stored in effective manner (buffered to disk for large requests)
AddAttempt(Attempt) // Add last proxy attempt to the request
GetAttempts() []Attempt // Returns last attempts to proxy request, may be nil if there are no attempts
GetLastAttempt() Attempt // Convenience method returning the last attempt, may be nil if there are no attempts
String() string // Debugging string representation of the request
SetUserData(key string, baton interface{}) // Provide storage space for data that survives with the request
GetUserData(key string) (interface{}, bool) // Fetch user data set from previously SetUserData call
DeleteUserData(key string) // Clean up user data set from previously SetUserData call
}
Request is a rapper around http request that provides more info about http.Request
Click to show internal directories.
Click to hide internal directories.