ResponseMatcher is a type which can determine if an HTTP response matches some criteria.
| 25 | // ResponseMatcher is a type which can determine if an |
| 26 | // HTTP response matches some criteria. |
| 27 | type ResponseMatcher struct { |
| 28 | // If set, one of these status codes would be required. |
| 29 | // A one-digit status can be used to represent all codes |
| 30 | // in that class (e.g. 3 for all 3xx codes). |
| 31 | StatusCode []int `json:"status_code,omitempty"` |
| 32 | |
| 33 | // If set, each header specified must be one of the |
| 34 | // specified values, with the same logic used by the |
| 35 | // [request header matcher](/docs/json/apps/http/servers/routes/match/header/). |
| 36 | Headers http.Header `json:"headers,omitempty"` |
| 37 | } |
| 38 | |
| 39 | // Match returns true if the given statusCode and hdr match rm. |
| 40 | func (rm ResponseMatcher) Match(statusCode int, hdr http.Header) bool { |
nothing calls this directly
no outgoing calls
no test coverage detected