Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddHeaders ¶ added in v1.9.0
AddHeaders - copy all the headers
Types ¶
type Configuration ¶ added in v1.9.0
Configuration - configuration
type Endpoint ¶ added in v1.9.0
type Endpoint struct { // URI - the endpoint's uri URI string // QueryString - the query string format QueryString []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.9.0
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) FirstRequest ¶ added in v1.10.0
func (*Server) RequestChannel ¶
RequestChannel - reads from the request channel
Click to show internal directories.
Click to hide internal directories.