Documentation ¶
Index ¶
- type MockHttp
- func (i *MockHttp) Fails(message string) *MockHttp
- func (i *MockHttp) For(comment string) *MockHttp
- func (i *MockHttp) NotFound() *MockHttp
- func (i *MockHttp) RedirectsTo(uri string) *MockHttp
- func (i *MockHttp) Respond(writer http.ResponseWriter, logger *log.Logger)
- func (i *MockHttp) RespondsEmpty() *MockHttp
- func (i *MockHttp) RespondsWith(body string) *MockHttp
- func (i *MockHttp) RespondsWithJson(obj interface{}) *MockHttp
- func (i *MockHttp) RespondsWithUnauthorized(body string) *MockHttp
- func (i *MockHttp) SetResponseCallback(b func(rawbody []byte))
- func (i *MockHttp) SkipAuthentication() *MockHttp
- func (i *MockHttp) Url() string
- func (i *MockHttp) Verify(req *http.Request, d *Server)
- func (i *MockHttp) WithAuthorizationHeader(auth string) *MockHttp
- func (i *MockHttp) WithBody(body string) *MockHttp
- func (i *MockHttp) WithContentType(contentType string) *MockHttp
- type MockedResponseBuilder
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockHttp ¶
type MockHttp struct {
// contains filtered or unexported fields
}
func NewMockedHttpRequest ¶
func (*MockHttp) RedirectsTo ¶
func (*MockHttp) Respond ¶
func (i *MockHttp) Respond(writer http.ResponseWriter, logger *log.Logger)
func (*MockHttp) RespondsEmpty ¶
func (*MockHttp) RespondsWith ¶
func (*MockHttp) RespondsWithJson ¶
func (*MockHttp) RespondsWithUnauthorized ¶
func (*MockHttp) SetResponseCallback ¶
func (*MockHttp) SkipAuthentication ¶
func (*MockHttp) WithAuthorizationHeader ¶
func (*MockHttp) WithContentType ¶
type MockedResponseBuilder ¶
type Server ¶
func StartServer ¶
func (*Server) ExpectedAuthorizationHeader ¶
func (*Server) ExpectedBasicAuth ¶
func (*Server) ServeHTTP ¶
func (d *Server) ServeHTTP(writer http.ResponseWriter, req *http.Request)
func (*Server) VerifyAndMock ¶
func (d *Server) VerifyAndMock(mockedResponses ...MockedResponseBuilder)
func (*Server) VerifyMocks ¶
func (d *Server) VerifyMocks()
Click to show internal directories.
Click to hide internal directories.