Documentation
¶
Index ¶
- Constants
- func PathPrefix(prefix string) string
- type Matcher
- type Mocker
- func (r *Mocker) GetStubs() []*Stub
- func (r *Mocker) RegisterResponder(method, path string, resp Responder)
- func (r *Mocker) RegisterResponderWithBody(method, path, body string, resp Responder)
- func (r *Mocker) RegisterReusableResponder(method, path string, resp Responder)
- func (r *Mocker) RegisterReusableResponderWithBody(method, path, body string, resp Responder)
- func (r *Mocker) RoundTrip(req *http.Request) (*http.Response, error)
- func (r *Mocker) Verify(t Testing)
- type Responder
- type Stub
- type Testing
Constants ¶
View Source
const ( PathOnly matchType = iota HostOnly FullURL HostAndPath PathAndQuerystring )
Variables ¶
This section is empty.
Functions ¶
func PathPrefix ¶ added in v1.66.0
PathPrefix returns a matcher that matches any path with the given prefix
Types ¶
type Mocker ¶
type Mocker struct { Requests []*http.Request MatchURL matchType // if false, only matches the path and if true, matches full url Debug bool // Add a debug flag for additional logging // contains filtered or unexported fields }
func (*Mocker) RegisterResponder ¶
func (*Mocker) RegisterResponderWithBody ¶
func (*Mocker) RegisterReusableResponder ¶ added in v1.66.0
func (*Mocker) RegisterReusableResponderWithBody ¶ added in v1.66.0
Click to show internal directories.
Click to hide internal directories.