MCPcopy Create free account
hub / github.com/BryanMwangi/pine / AddRoute

Method AddRoute

group.go:26–28  ·  view source on GitHub ↗

AddRoute registers a route under the group's prefix with group middleware applied.

(method, path string, handlers ...Handler)

Source from the content-addressed store, hash-verified

24
25// AddRoute registers a route under the group's prefix with group middleware applied.
26func (g *Group) AddRoute(method, path string, handlers ...Handler) {
27 g.server.AddRoute(method, joinPath(g.prefix, path), g.wrapGroupHandlers(handlers)...)
28}
29
30func (g *Group) Get(path string, handlers ...Handler) { g.AddRoute(MethodGet, path, handlers...) }
31func (g *Group) Post(path string, handlers ...Handler) { g.AddRoute(MethodPost, path, handlers...) }

Callers 7

GetMethod · 0.95
PostMethod · 0.95
PutMethod · 0.95
PatchMethod · 0.95
DeleteMethod · 0.95
OptionsMethod · 0.95
TestAddRoute_ValidMethodFunction · 0.45

Calls 2

wrapGroupHandlersMethod · 0.95
joinPathFunction · 0.85

Tested by 1

TestAddRoute_ValidMethodFunction · 0.36