Documentation
¶
Index ¶
- Constants
- type BodyMatcher
- type MockClient
- func (c MockClient) Clear(matcher RequestMatcher) error
- func (c MockClient) Verify(matcher RequestMatcher, times Times) error
- func (c MockClient) VerifyAndClear(matcher RequestMatcher, times Times) error
- func (c MockClient) VerifyAndClearByHeader(headerName, headerValue string, matcher RequestMatcher, times Times) error
- type RequestMatcher
- type Times
Constants ¶
View Source
const ( StrictMatch = "STRICT" TolerantMatch = "ONLY_MATCHING_FIELDS" )
View Source
const (
MatchBodyJSON = "JSON"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BodyMatcher ¶
type MockClient ¶
type MockClient struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(host string, port int) MockClient
func (MockClient) Clear ¶
func (c MockClient) Clear(matcher RequestMatcher) error
func (MockClient) Verify ¶
func (c MockClient) Verify(matcher RequestMatcher, times Times) error
func (MockClient) VerifyAndClear ¶
func (c MockClient) VerifyAndClear(matcher RequestMatcher, times Times) error
func (MockClient) VerifyAndClearByHeader ¶
func (c MockClient) VerifyAndClearByHeader(headerName, headerValue string, matcher RequestMatcher, times Times) error
type RequestMatcher ¶
type RequestMatcher struct {
Method string `json:"method,omitempty"`
Path string `json:"path,omitempty"`
Body BodyMatcher `json:"body,omitempty"`
Headers map[string][]string `json:"headers,omitempty"`
}
func (RequestMatcher) WithHeader ¶
func (m RequestMatcher) WithHeader(key, value string) RequestMatcher
func (RequestMatcher) WithJsonFields ¶
func (m RequestMatcher) WithJsonFields(json map[string]interface{}) RequestMatcher
Click to show internal directories.
Click to hide internal directories.