本文整理匯總了Golang中github.com/labstack/echo.Group.Use方法的典型用法代碼示例。如果您正苦於以下問題:Golang Group.Use方法的具體用法?Golang Group.Use怎麽用?Golang Group.Use使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/labstack/echo.Group
的用法示例。
在下文中一共展示了Group.Use方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: Configure
// Configure setups all resource functions in order to work with database operations
func Configure(g *echo.Group) {
g.Use(auth.AnyAuth())
g.Post("/", msg.JSONResource(Create))
g.Get("/:id", msg.JSONResource(Retrieve))
g.Patch("/:id", msg.JSONResource(Update))
g.Delete("/:id", msg.JSONResource(Delete))
}
示例2: Configure
// Configure will set all routes needed by this module
func Configure(g *echo.Group) {
g.Use(auth.AnyAuth())
g.Get("/", msg.JSONResource(List))
g.Get("/:gid", msg.JSONResource(Create))
g.Post("/:gid", msg.JSONResource(Retrieve))
g.Patch("/:gid", msg.JSONResource(Update))
g.Delete("/:gid", msg.JSONResource(Delete))
g.Post("/:gid/members/:mid", msg.JSONResource(AddMember))
g.Post("/:gid/members/:mid/admin", msg.JSONResource(AddAdmin))
g.Delete("/:gid/members/:mid/admin", msg.JSONResource(DelAdmin))
g.Delete("/:gid/members/:mid", msg.JSONResource(DelMember))
}
示例3: Configure
// Configure setups all resource functions in order to work with database operations
func Configure(g *echo.Group) {
g.Use(auth.AnyAuth())
g.Post("/", msg.JSONResource(ExchageDigits))
g.Delete("/:id", msg.JSONResource(CloseSession))
}
示例4: ConfigureHTTPGroup
// ConfigureHTTPGroup setups the websocket listener
func ConfigureHTTPGroup(g *echo.Group) {
g.Use(auth.AnyAuth())
g.WebSocket("", msg.JSONResource(AcceptClient))
}