Documentation ¶
Index ¶
- type Handler
- func (i *Handler) DelayResponse(delay time.Duration) *Handler
- func (i *Handler) For(comment string) *Handler
- func (i *Handler) RedirectsTo(uri string) *Handler
- func (i *Handler) Respond(writer http.ResponseWriter, logger *log.Logger)
- func (i *Handler) RespondsAcceptedWith(body string) *Handler
- func (i *Handler) RespondsConflict() *Handler
- func (i *Handler) RespondsCreated() *Handler
- func (i *Handler) RespondsForbiddenWith(body string) *Handler
- func (i *Handler) RespondsInternalServerErrorWith(body string) *Handler
- func (i *Handler) RespondsNoContent() *Handler
- func (i *Handler) RespondsNotFoundWith(body string) *Handler
- func (i *Handler) RespondsOKWith(body string) *Handler
- func (i *Handler) RespondsOKWithJSON(obj interface{}) *Handler
- func (i *Handler) RespondsUnauthorizedWith(body string) *Handler
- func (i *Handler) RunsFunction(expectedFunction func()) *Handler
- func (i *Handler) Url() string
- func (i *Handler) Verify(req *http.Request, s *Server)
- func (i *Handler) WithAuthorizationHeader(auth string) *Handler
- func (i *Handler) WithBody(body string) *Handler
- func (i *Handler) WithContentType(contentType string) *Handler
- func (i *Handler) WithHeader(header, value string) *Handler
- func (i *Handler) WithHeaderPresent(header string) *Handler
- func (i *Handler) WithJSONBody(body string) *Handler
- func (i *Handler) WithRegexURLMatcher() *Handler
- func (i *Handler) WithoutHeader(header string) *Handler
- type MockedResponseBuilder
- type Server
- func (s *Server) AppendMocks(mockedResponses ...MockedResponseBuilder)
- func (s *Server) ExcludeAuthorizationCheck(path string)
- func (s *Server) ExpectedAuthorizationHeader(header string)
- func (s *Server) ExpectedBasicAuth(username, password string)
- func (s *Server) ServeHTTP(writer http.ResponseWriter, req *http.Request)
- func (s *Server) VerifyAndMock(mockedResponses ...MockedResponseBuilder)
- func (s *Server) VerifyMocks()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewMockedHttpRequest ¶
func (*Handler) RedirectsTo ¶
func (*Handler) RespondsAcceptedWith ¶
func (*Handler) RespondsConflict ¶
func (*Handler) RespondsCreated ¶
func (*Handler) RespondsForbiddenWith ¶
func (*Handler) RespondsInternalServerErrorWith ¶
func (*Handler) RespondsNoContent ¶
func (*Handler) RespondsNotFoundWith ¶
func (*Handler) RespondsOKWith ¶
func (*Handler) RespondsOKWithJSON ¶
func (*Handler) RespondsUnauthorizedWith ¶
func (*Handler) RunsFunction ¶
func (*Handler) WithAuthorizationHeader ¶
func (*Handler) WithContentType ¶
func (*Handler) WithHeader ¶
func (*Handler) WithHeaderPresent ¶
func (*Handler) WithJSONBody ¶
func (*Handler) WithRegexURLMatcher ¶
func (*Handler) WithoutHeader ¶
type MockedResponseBuilder ¶
type Server ¶
func StartServer ¶
func StartTLSServer ¶
func (*Server) AppendMocks ¶
func (s *Server) AppendMocks(mockedResponses ...MockedResponseBuilder)
func (*Server) ExcludeAuthorizationCheck ¶
func (*Server) ExpectedAuthorizationHeader ¶
func (*Server) ExpectedBasicAuth ¶
func (*Server) ServeHTTP ¶
func (s *Server) ServeHTTP(writer http.ResponseWriter, req *http.Request)
func (*Server) VerifyAndMock ¶
func (s *Server) VerifyAndMock(mockedResponses ...MockedResponseBuilder)
func (*Server) VerifyMocks ¶
func (s *Server) VerifyMocks()
Click to show internal directories.
Click to hide internal directories.