Documentation ¶
Index ¶
- func CloneRequestWithBody(r *http.Request) *http.Request
- func CloneResponseWithBody(r *http.Response) *http.Response
- func HashRequest(r *http.Request, filters ...RequestFilter) (hashKey string, err error)
- func NewRequestRecorderMiddleware(params RequestRecorderMiddlewareParams) (func(next http.Handler) http.Handler, error)
- func NewSingleResponseClient(entry Entry) *http.Client
- func RequestToBuff(r *http.Request, filters ...RequestFilter) *bytes.Buffer
- func WithProxyTransport(client *http.Client, proxyURL *url.URL) *http.Client
- type ContentType
- type Creator
- type Entry
- type HarFile
- type Header
- type Headers
- type Log
- type PostData
- type QueryParam
- type QueryParams
- type ReplayOption
- func WithDelHeaderFilter(key string) ReplayOption
- func WithHarDir(dirname string) ReplayOption
- func WithHarFile(filename string) ReplayOption
- func WithRequestFilter(filter RequestFilter) ReplayOption
- func WithRequestRecorder(rec *RequestRecorder) ReplayOption
- func WithRoundTripDebugger() ReplayOption
- type ReplayTransport
- type Request
- type RequestFilter
- type RequestRecord
- type RequestRecorder
- type RequestRecorderMiddlewareParams
- type Response
- type ResponseFactory
- type ResponseFilter
- type SingleResponseTransport
- type Timing
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HashRequest ¶
func HashRequest(r *http.Request, filters ...RequestFilter) (hashKey string, err error)
func NewSingleResponseClient ¶
func RequestToBuff ¶
func RequestToBuff(r *http.Request, filters ...RequestFilter) *bytes.Buffer
Types ¶
type ContentType ¶
type Entry ¶
type Entry struct { Time float64 `json:"time"` IsHTTPS bool `json:"_isHTTPS"` WebSocketMessages any `json:"_webSocketMessages"` RemoteDeviceIP string `json:"_remoteDeviceIP"` Timings Timing `json:"timings"` ServerAddress string `json:"_serverAddress"` IsIntercepted bool `json:"_isIntercepted"` Id string `json:"_id"` ServerIPAddress string `json:"serverIPAddress"` Name string `json:"_name"` ClientAddress string `json:"_clientAddress"` ClientBundlePath any `json:"_clientBundlePath"` Request Request `json:"request"` ServerPort int `json:"_serverPort"` ClientName any `json:"_clientName"` ClientPort int `json:"_clientPort"` Response Response `json:"response"` Comment string `json:"comment"` StartedDateTime time.Time `json:"startedDateTime"` }
type QueryParam ¶
type QueryParams ¶
type QueryParams []QueryParam
func (QueryParams) ToURLValues ¶
func (q QueryParams) ToURLValues() (v url.Values)
type ReplayOption ¶
type ReplayOption func(transport *ReplayTransport) error
func WithDelHeaderFilter ¶
func WithDelHeaderFilter(key string) ReplayOption
func WithHarDir ¶
func WithHarDir(dirname string) ReplayOption
func WithHarFile ¶
func WithHarFile(filename string) ReplayOption
func WithRequestFilter ¶
func WithRequestFilter(filter RequestFilter) ReplayOption
func WithRequestRecorder ¶
func WithRequestRecorder(rec *RequestRecorder) ReplayOption
func WithRoundTripDebugger ¶
func WithRoundTripDebugger() ReplayOption
type ReplayTransport ¶
type ReplayTransport struct {
// contains filtered or unexported fields
}
func NewReplayTransport ¶
func NewReplayTransport(opts ...ReplayOption) (rt *ReplayTransport, err error)
func (*ReplayTransport) NewClient ¶
func (r *ReplayTransport) NewClient() *http.Client
type Request ¶
type Request struct { Method string `json:"method"` BodySize int `json:"bodySize"` HeadersSize int `json:"headersSize"` PostData PostData `json:"postData"` Cookies []interface{} `json:"cookies"` Headers Headers `json:"headers"` QueryString QueryParams `json:"queryString"` HttpVersion string `json:"httpVersion"` Url string `json:"url"` }
type RequestFilter ¶
type RequestRecord ¶
type RequestRecorder ¶
type RequestRecorder struct {
// contains filtered or unexported fields
}
func NewRequestRecorder ¶
func NewRequestRecorder() *RequestRecorder
type Response ¶
type Response struct { Status int `json:"status"` Content ContentType `json:"content"` BodySize int `json:"bodySize"` HeadersSize int `json:"headersSize"` Cookies []any `json:"cookies"` StatusText string `json:"statusText"` Headers Headers `json:"headers"` HttpVersion string `json:"httpVersion"` RedirectURL string `json:"redirectURL"` }
type ResponseFactory ¶
type ResponseFilter ¶
type SingleResponseTransport ¶
type SingleResponseTransport struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.