Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler interface {
ServeHTTP(req *HttpRequest, c net.Conn)
}
type HandlerFunc ¶
type HandlerFunc func(req *HttpRequest) HttpResponse
type HttpRequest ¶
type HttpRequest struct {
Method string
Path string
Ip string
HTTPVersion string
Headers map[string]string
Body string
UrlParams QueryParameter
}
func ParseHttpRequest ¶
func ParseHttpRequest(req, ip string) *HttpRequest
type HttpResponse ¶
type HttpResponse struct {
Code int
Message string
Protocol string
Body string
Headers map[string]string
}
func Response ¶
func Response(code int, body, contentType string) HttpResponse
type Mux ¶
type Mux struct {
// contains filtered or unexported fields
}
func (*Mux) HandlerFunc ¶
func (m *Mux) HandlerFunc(path string, handler HandlerFunc)
type QueryParameter ¶
Click to show internal directories.
Click to hide internal directories.