Documentation
¶
Index ¶
- Variables
- type Controller
- type ControllerWrapper
- type Logger
- type Router
- func (r *Router) HandleFunc(path string, handler http.HandlerFunc)
- func (r *Router) Handler() *http.ServeMux
- func (r *Router) NewGroup(path string) *Router
- func (r *Router) RegisterGroup(path string, router *Router)
- func (r *Router) RegisterHandler(path string, handler http.Handler)
- func (r *Router) RegisterRoute(path string, handler http.HandlerFunc)
- type RouterWrapper
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Controller ¶ added in v0.2.1
type Controller struct {
RouterWrapper
}
Controller is the struct for the route controller
type ControllerWrapper ¶ added in v0.2.2
type ControllerWrapper interface {
RegisterRoutes()
RegisterGroups()
}
ControllerWrapper is the interface for the route controller
type Logger ¶ added in v0.4.0
type Logger struct {
// contains filtered or unexported fields
}
Logger is the logger for router
func (*Logger) RegisterRoute ¶ added in v0.4.0
RegisterRoute registers a route
func (*Logger) RegisterRouteGroup ¶ added in v0.4.0
RegisterRouteGroup registers a route group
type Router ¶ added in v0.2.2
type Router struct {
// contains filtered or unexported fields
}
Router is the route group struct
func NewBaseRouter ¶ added in v0.4.2
func NewBaseRouter(mode *goflagsmode.Flag, logger *Logger) *Router
NewBaseRouter creates a new base router
func NewRouter ¶ added in v0.2.2
func NewRouter(path string, mode *goflagsmode.Flag, logger *Logger) *Router
NewRouter creates a new router
func (*Router) HandleFunc ¶ added in v0.2.2
func (r *Router) HandleFunc(path string, handler http.HandlerFunc)
HandleFunc registers a new route with a path and a handler function
func (*Router) RegisterGroup ¶ added in v0.4.2
RegisterGroup registers a new router group with a path and a router
func (*Router) RegisterHandler ¶ added in v0.2.2
RegisterHandler registers a new route group with a path and a handler function
func (*Router) RegisterRoute ¶ added in v0.2.2
func (r *Router) RegisterRoute(path string, handler http.HandlerFunc)
RegisterRoute registers a new route with a path and a handler function
type RouterWrapper ¶ added in v0.2.2
type RouterWrapper interface {
Handler() *http.ServeMux
HandleFunc(path string, handler http.HandlerFunc)
RegisterRoute(path string, handler http.HandlerFunc)
RegisterHandler(path string, handler http.Handler)
NewGroup(path string) *Router
RegisterGroup(path string, router *Router)
}
RouterWrapper is the interface for the routes