mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
tech: adds comments about route register code
This commit is contained in:
@@ -14,15 +14,30 @@ type Router interface {
|
|||||||
// RouteRegister allows you to add routes and macaron.Handlers
|
// RouteRegister allows you to add routes and macaron.Handlers
|
||||||
// that the web server should serve.
|
// that the web server should serve.
|
||||||
type RouteRegister interface {
|
type RouteRegister interface {
|
||||||
|
// Get adds a list of handlers to a given route with a GET HTTP verb
|
||||||
Get(string, ...macaron.Handler)
|
Get(string, ...macaron.Handler)
|
||||||
|
|
||||||
|
// Post adds a list of handlers to a given route with a POST HTTP verb
|
||||||
Post(string, ...macaron.Handler)
|
Post(string, ...macaron.Handler)
|
||||||
|
|
||||||
|
// Delete adds a list of handlers to a given route with a DELETE HTTP verb
|
||||||
Delete(string, ...macaron.Handler)
|
Delete(string, ...macaron.Handler)
|
||||||
|
|
||||||
|
// Put adds a list of handlers to a given route with a PUT HTTP verb
|
||||||
Put(string, ...macaron.Handler)
|
Put(string, ...macaron.Handler)
|
||||||
|
|
||||||
|
// Patch adds a list of handlers to a given route with a PATCH HTTP verb
|
||||||
Patch(string, ...macaron.Handler)
|
Patch(string, ...macaron.Handler)
|
||||||
|
|
||||||
|
// Any adds a list of handlers to a given route with any HTTP verb
|
||||||
Any(string, ...macaron.Handler)
|
Any(string, ...macaron.Handler)
|
||||||
|
|
||||||
|
// Group allows you to pass a function that can add multiple routes
|
||||||
|
// with a shared prefix route.
|
||||||
Group(string, func(RouteRegister), ...macaron.Handler)
|
Group(string, func(RouteRegister), ...macaron.Handler)
|
||||||
|
|
||||||
|
// Register iterates over all routes added to the RouteRegister
|
||||||
|
// and add them to the `Router` pass as an parameter.
|
||||||
Register(Router) *macaron.Router
|
Register(Router) *macaron.Router
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user