Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddHeaders ¶ added in v1.8.3
AddHeaders - copy all the headers
Types ¶
type Configuration ¶ added in v1.6.0
type Configuration struct { Host string Port int ChannelSize int Responses map[string][]Endpoint T *testing.T }
Configuration - configuration
type Endpoint ¶ added in v1.8.3
type Endpoint struct { // URI - the endpoint's uri URI string // Methods - the list of http methods (GET, POST, ...) containing the respective response Methods map[string]Response // Regexp - activates regular expression for uris Regexp bool }
Endpoint - an endpoint to be listened
type Response ¶ added in v1.8.3
type Response struct { // Body - the body to be put in the response Body interface{} // Headers - the headers to be included in the response Headers http.Header // Status - the code status to be returned Status int // Wait - a time to wait until responds Wait time.Duration }
Response - the endpoint response data
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server - the server listening for HTTP requests
func NewServer ¶
func NewServer(configuration *Configuration) *Server
NewServer - creates a new HTTP listener server
func (*Server) RequestChannel ¶
RequestChannel - reads from the request channel
Click to show internal directories.
Click to hide internal directories.