Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustReadFile ¶
func NewHTTPTestServer ¶
NewHTTPTestServer creates a server with default 404 content response return logic. One can configure server with route objects and responses that should be returned on the certain urls (like ^/artifactory/.*$ will be matched with all urls that starts with /artifactory/)
Types ¶
type HTTPBuffer ¶
type HTTPBuffer struct {
// contains filtered or unexported fields
}
HTTPBuffer is a http in-memory buffer used for testing
func (*HTTPBuffer) Header ¶
func (h *HTTPBuffer) Header() http.Header
Header implements http.ResponseWriter interface.
func (*HTTPBuffer) String ¶
func (h *HTTPBuffer) String() string
String implements fmt.Stringer interface.
func (*HTTPBuffer) Write ¶
func (h *HTTPBuffer) Write(p []byte) (n int, err error)
Write implements http.ResponseWriter interface.
func (*HTTPBuffer) WriteHeader ¶
func (h *HTTPBuffer) WriteHeader(statusCode int)
WriteHeader implements http.ResponseWriter interface.
type Options ¶
type Options struct {
Status int
}
Options sets different response options to set in http testing responses
Click to show internal directories.
Click to hide internal directories.