Versions in this module Expand all Collapse all v0 v0.3.1 Jan 31, 2022 v0.3.0 Oct 24, 2019 v0.2.0 Sep 5, 2019 v0.1.0 Sep 5, 2019 Changes in this version + func AtLeast(times int) verifyOpt + func AtMost(times int) verifyOpt + func MustReadAll(t *testing.T, r io.Reader) []byte + func Never() verifyOpt + func NewClientEndpoint() *clientEndpoint + func NewServerEndpoint() *serverEndpoint + func Once() verifyOpt + func Request() *requestMatcher + func Response() *response + func Times(expected int) verifyOpt + func WithServers(serverSpecs ServerSpecs, test TestWithMockServers) + type Client struct + func NewClient(endpoints ...ClientEndpoint) *Client + func (c *Client) AcceptedRequests() []recordedRequest + func (c *Client) ClearHistory() + func (c *Client) HttpClient() *http.Client + func (c *Client) UnmatchedRequests() []recordedRequest + type ClientEndpoint interface + Matches func(request *http.Request) bool + type RoundTripFunc func(*http.Request) (*http.Response, error) + type Server struct + Port int + func StartServer(opts ...ServerOpt) *Server + func (mockSvr *Server) AcceptedRequests() []recordedRequest + func (mockSvr *Server) AddEndpoint(endpoint ServerEndpoint) + func (mockSvr *Server) BaseUrl() string + func (mockSvr *Server) BuildUrl(path string) string + func (mockSvr *Server) Clear() + func (mockSvr *Server) ClearHistory() + func (mockSvr *Server) Close() + func (mockSvr *Server) String() string + func (mockSvr *Server) UnmatchedRequests() []recordedRequest + func (mockSvr *Server) Verify(matcher *requestMatcher, opts ...verifyOpt) error + func (mockSvr *Server) WaitFor(ctx context.Context, matcher *requestMatcher) error + type ServerEndpoint interface + Matches func(request *http.Request) bool + type ServerOpt func(*Server) + func WithEndpoints(endpoints ...ServerEndpoint) ServerOpt + func WithName(name string) ServerOpt + func WithTls(config *tls.Config) ServerOpt + type ServerSpecs map[string][]ServerEndpoint + type Servers map[string]*Server + type TestWithMockServers func(servers Servers)