Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Log *logs.Logger = InitLogger(log_level.ErrorLvlName)
Functions ¶
func InitLogger ¶
func InitLogger(logLevel log_level.LogLvlName) *logs.Logger
Types ¶
type HttpMethod ¶
type HttpMethod string
const ( GET HttpMethod = `GET` HEAD HttpMethod = `HEAD` OPTIONS HttpMethod = `OPTIONS` TRACE HttpMethod = `TRACE` PUT HttpMethod = `PUT` DELETE HttpMethod = `DELETE` POST HttpMethod = `POST` PATCH HttpMethod = `PATCH` CONNECT HttpMethod = `CONNECT` )
type HttpRequestHandler ¶
type HttpRequestHandler func(req *http.Request, params Params) *HttpResponse
type HttpResponse ¶
type HttpResponse struct {
// contains filtered or unexported fields
}
func NewHttpResponse ¶
func NewHttpResponse(status int) *HttpResponse
func (*HttpResponse) SetBody ¶
func (r *HttpResponse) SetBody(body string) *HttpResponse
func (*HttpResponse) SetHeader ¶
func (r *HttpResponse) SetHeader(key string, value string) *HttpResponse
type RequestHandlerMap ¶
type RequestHandlerMap map[HttpMethod]map[string]RequestHandlerPackage
type RequestHandlerPackage ¶
type RequestHandlerPackage struct {
Handler HttpRequestHandler
ParamList map[int]string
Params Params
}
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
func (*Router) RegisterRoute ¶
func (r *Router) RegisterRoute(method HttpMethod, path string, handler HttpRequestHandler)
----------- ROUTE REGISTRATION -----------
func (*Router) RegisteredRoutes ¶
func (r *Router) RegisteredRoutes() *RequestHandlerMap
Click to show internal directories.
Click to hide internal directories.