MCPcopy Index your code
hub / github.com/labstack/echo / Add

Method Add

group.go:158–169  ·  view source on GitHub ↗

Add implements `Echo#Add()` for sub-routes within the Group. Panics on error.

(method, path string, handler HandlerFunc, middleware ...MiddlewareFunc)

Source from the content-addressed store, hash-verified

156
157// Add implements `Echo#Add()` for sub-routes within the Group. Panics on error.
158func (g *Group) Add(method, path string, handler HandlerFunc, middleware ...MiddlewareFunc) RouteInfo {
159 ri, err := g.AddRoute(Route{
160 Method: method,
161 Path: path,
162 Handler: handler,
163 Middlewares: middleware,
164 })
165 if err != nil {
166 panic(err) // this is how `v4` handles errors. `v5` has methods to have panic-free usage
167 }
168 return ri
169}
170
171// AddRoute registers a new Routable with Router
172func (g *Group) AddRoute(route Route) (RouteInfo, error) {

Callers 13

CONNECTMethod · 0.95
DELETEMethod · 0.95
GETMethod · 0.95
HEADMethod · 0.95
OPTIONSMethod · 0.95
PATCHMethod · 0.95
POSTMethod · 0.95
PUTMethod · 0.95
TRACEMethod · 0.95
AnyMethod · 0.95
StaticFSMethod · 0.95
FileMethod · 0.95

Calls 1

AddRouteMethod · 0.95

Tested by

no test coverage detected