Documentation ¶
Overview ¶
Package router handels theroutiing Author: Maritn Starman
Index ¶
- Variables
- type ByIndex
- type HTTPHandler
- type Manager
- type SubManager
- func (r *SubManager) All(route string, handler ...HTTPHandler)
- func (r *SubManager) Delete(route string, handler ...HTTPHandler)
- func (r *SubManager) Get(route string, handler ...HTTPHandler)
- func (r *SubManager) Post(route string, handler ...HTTPHandler)
- func (r *SubManager) Put(route string, handler ...HTTPHandler)
- func (r *SubManager) Use(route string, handler ...http.HandlerFunc)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // NotFoundHandler function if path not found NotFoundHandler func(w http.ResponseWriter, r *request.Request) // ErrorHandler reponshandler on Error ErrorHandler func(err error, w http.ResponseWriter, r *request.Request) // XHRNotFoundHandler function if path not found XHRNotFoundHandler func(w http.ResponseWriter, r *request.Request) // XHRErrorHandler reponshandler on Error XHRErrorHandler func(err error, w http.ResponseWriter, r *request.Request) )
Functions ¶
This section is empty.
Types ¶
type ByIndex ¶
type ByIndex []*finalRouteElement
ByAge implements sort.Interface for []Person based on the Age field.
type HTTPHandler ¶
HTTPHandler defines Type
type Manager ¶
type Manager struct {
*SubManager
}
Manager instance of router
func (*Manager) UploadPath ¶
func (r *Manager) UploadPath(path string, isBuffer bool) HTTPHandler
UploadPath Registers a upload Path
type SubManager ¶
type SubManager struct {
// contains filtered or unexported fields
}
SubManager manages routs in a sub path
func NewSubRouter ¶
func NewSubRouter(root string) *SubManager
NewSubRouter returns new instance of the Router
func NewXHRSubRouter ¶
func NewXHRSubRouter(root string) *SubManager
NewXHRSubRouter returns new instance of the Router
func (*SubManager) All ¶
func (r *SubManager) All(route string, handler ...HTTPHandler)
All register a route for the All methods
func (*SubManager) Delete ¶
func (r *SubManager) Delete(route string, handler ...HTTPHandler)
Delete register a route for the Delete method
func (*SubManager) Get ¶
func (r *SubManager) Get(route string, handler ...HTTPHandler)
Get registers a route for the GET method
func (*SubManager) Post ¶
func (r *SubManager) Post(route string, handler ...HTTPHandler)
Post register a route for the POST method
func (*SubManager) Put ¶
func (r *SubManager) Put(route string, handler ...HTTPHandler)
Put register a route for the Put method
func (*SubManager) Use ¶
func (r *SubManager) Use(route string, handler ...http.HandlerFunc)
Use is to register a api for GET, POST, DELETE,and PUT
Click to show internal directories.
Click to hide internal directories.