Documentation ¶
Index ¶
- func DefaultMatcher(stored *http.Request, incoming *http.Request) bool
- func DefaultProcessRequest(req *http.Request) *http.Request
- func DefaultProcessResponse(res *http.Response) *http.Response
- type Fixture
- func (f *Fixture) Add(originalReq *http.Request, originalRes *http.Response)
- func (f *Fixture) Delete(id string) bool
- func (f *Fixture) Entries() []*storage.Entry
- func (f *Fixture) Match(originalReq *http.Request) (string, *http.Response)
- func (f *Fixture) Save() error
- func (f *Fixture) WithMatcher(matcher Matcher)
- func (f *Fixture) WithRequestProcessor(processRequest RequestProcessor)
- func (f *Fixture) WithResponseProcessor(processResponse ResponseProcessor)
- type Matcher
- type RequestProcessor
- type ResponseProcessor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultMatcher ¶
DefaultMatcher is a default implementation of Matcher. It compares the request method, url, headers, and body to the stored request.
func DefaultProcessRequest ¶
DefaultProcessRequest is a default implementation of ProcessRequest. It removes the Date, Cookie, Authorization, and User-Agent headers.
Types ¶
type Fixture ¶
type Fixture struct {
// contains filtered or unexported fields
}
func (*Fixture) Add ¶
Add processes the http.Request and http.Response with the Fixture's RequestProcessor and ResponseProcessor and adds them to the Fixure's Storage.
func (*Fixture) WithMatcher ¶
WithMatcher sets the Matcher for the Fixture. Note: Overriding the fixture's matcher will not affect the host matching behavior that can be configured in proxy.json.
func (*Fixture) WithRequestProcessor ¶
func (f *Fixture) WithRequestProcessor(processRequest RequestProcessor)
WithRequestProcessor sets the RequestProcessor for the Fixture.
func (*Fixture) WithResponseProcessor ¶
func (f *Fixture) WithResponseProcessor(processResponse ResponseProcessor)
WithResponseProcessor sets the ResponseProcessor for the Fixture.