Documentation ¶
Index ¶
Constants ¶
View Source
const ( // TestServerHost - the test server's hostname TestServerHost = "localhost" // TestServerPort - the test server's port TestServerPort = 18080 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HTTPServer ¶
type HTTPServer struct {
// contains filtered or unexported fields
}
HTTPServer - the server listening for HTTP requests
func CreateNewTestHTTPServer ¶
func CreateNewTestHTTPServer(responses []ResponseData) *HTTPServer
CreateNewTestHTTPServer - creates a new server
func NewHTTPServer ¶
func NewHTTPServer(host string, port, channelSize int, responses []ResponseData) (*HTTPServer, error)
NewHTTPServer - creates a new HTTP listener server
func (*HTTPServer) RequestChannel ¶
func (hl *HTTPServer) RequestChannel() <-chan *RequestData
RequestChannel - reads from the request channel
type RequestData ¶
RequestData - the request data sent to the server
func WaitForHTTPServerRequest ¶
func WaitForHTTPServerRequest(server *HTTPServer) *RequestData
WaitForHTTPServerRequest - wait until timeout or for the server sets the request in the channel
type ResponseData ¶
type ResponseData struct { RequestData Status int }
ResponseData - the expected response data for each configured URI
func ParseResponse ¶
func ParseResponse(res *http.Response) (*ResponseData, error)
ParseResponse - parses the response using the local struct as result
Click to show internal directories.
Click to hide internal directories.