Documentation ¶
Index ¶
- type HTTPRecorder
- type LogEntry
- type Request
- type RequestLog
- func (l *RequestLog) AddEntry(entry *LogEntry)
- func (l *RequestLog) FormatHTTP() string
- func (l *RequestLog) RegexReplaceURL(find string, replace string)
- func (l *RequestLog) RemoveHeader(k string)
- func (l *RequestLog) RemoveUserAgent()
- func (l *RequestLog) ReplaceTimestamp()
- func (l *RequestLog) ReplaceURLPrefix(old, new string)
- func (l *RequestLog) SortGETs()
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPRecorder ¶
type HTTPRecorder struct {
// contains filtered or unexported fields
}
func NewRecorder ¶
func NewRecorder(inner http.RoundTripper, log *RequestLog) *HTTPRecorder
type LogEntry ¶
type LogEntry struct { Request Request `json:"request,omitempty"` Response Response `json:"response,omitempty"` Error string `json:"error,omitempty"` }
func (*LogEntry) FormatHTTP ¶
type Request ¶
type Request struct { Method string `json:"method,omitempty"` URL string `json:"url,omitempty"` Header http.Header `json:"header,omitempty"` Body string `json:"body,omitempty"` }
func (*Request) FormatHTTP ¶
type RequestLog ¶
type RequestLog struct {
// contains filtered or unexported fields
}
func (*RequestLog) AddEntry ¶
func (l *RequestLog) AddEntry(entry *LogEntry)
func (*RequestLog) FormatHTTP ¶
func (l *RequestLog) FormatHTTP() string
func (*RequestLog) RegexReplaceURL ¶
func (l *RequestLog) RegexReplaceURL(find string, replace string)
func (*RequestLog) RemoveHeader ¶
func (l *RequestLog) RemoveHeader(k string)
func (*RequestLog) RemoveUserAgent ¶
func (l *RequestLog) RemoveUserAgent()
func (*RequestLog) ReplaceTimestamp ¶
func (l *RequestLog) ReplaceTimestamp()
func (*RequestLog) ReplaceURLPrefix ¶
func (l *RequestLog) ReplaceURLPrefix(old, new string)
func (*RequestLog) SortGETs ¶
func (l *RequestLog) SortGETs()
SortGETs attempts to normalize parallel requests. Consecutive GET requests are sorted alphabetically.
Click to show internal directories.
Click to hide internal directories.