本文整理汇总了Golang中github.com/labstack/echo.Group类的典型用法代码示例。如果您正苦于以下问题:Golang Group类的具体用法?Golang Group怎么用?Golang Group使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Group类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: RegisterRoute
// 注册路由
func (self ResourceController) RegisterRoute(g *echo.Group) {
g.GET("/resources", self.ReadList)
g.GET("/resources/cat/:catid", self.ReadCatResources)
g.GET("/resources/:id", self.Detail)
g.Match([]string{"GET", "POST"}, "/resources/new", self.Create, middleware.NeedLogin(), middleware.Sensivite(), middleware.PublishNotice())
g.Match([]string{"GET", "POST"}, "/resources/modify", self.Modify, middleware.NeedLogin(), middleware.Sensivite())
}
开发者ID:studygolang,项目名称:studygolang,代码行数:8,代码来源:resource.go
示例2: RegisterRoute
// 注册路由
func (self ProjectController) RegisterRoute(g *echo.Group) {
g.GET("/projects", self.ReadList)
g.Match([]string{"GET", "POST"}, "/project/new", self.Create, middleware.NeedLogin(), middleware.Sensivite(), middleware.PublishNotice())
g.Match([]string{"GET", "POST"}, "/project/modify", self.Modify, middleware.NeedLogin(), middleware.Sensivite())
g.GET("/p/:uri", self.Detail)
g.GET("/project/uri", self.CheckExist)
}
开发者ID:studygolang,项目名称:studygolang,代码行数:8,代码来源:project.go
示例3: RegisterRoute
// 注册路由
func (self RuleController) RegisterRoute(g *echo.Group) {
g.GET("/crawl/rule/list", self.RuleList)
g.POST("/crawl/rule/query.html", self.Query)
g.Match([]string{"GET", "POST"}, "/crawl/rule/new", self.New)
g.Match([]string{"GET", "POST"}, "/crawl/rule/modify", self.Modify)
g.POST("/crawl/rule/del", self.Del)
}
开发者ID:studygolang,项目名称:studygolang,代码行数:8,代码来源:rule.go
示例4: 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))
}
开发者ID:cedmundo,项目名称:hablo,代码行数:8,代码来源:profiles.go
示例5: RegisterRoute
// 注册路由
func (self MessageController) RegisterRoute(g *echo.Group) {
messageG := g.Group("/message/", middleware.NeedLogin())
messageG.GET(":msgtype", self.ReadList)
messageG.GET("system", self.ReadList)
messageG.Match([]string{"GET", "POST"}, "send", self.Send)
messageG.POST("delete", self.Delete)
// g.GET("/message/:msgtype", self.ReadList, middleware.NeedLogin())
// g.GET("/message/system", self.ReadList, middleware.NeedLogin())
// g.Match([]string{"GET", "POST"}, "/message/send", self.Send, middleware.NeedLogin())
// g.POST("/message/delete", self.Delete, middleware.NeedLogin())
}
开发者ID:studygolang,项目名称:studygolang,代码行数:14,代码来源:message.go
示例6: RegisterRoute
// 注册路由
func (self ProjectController) RegisterRoute(g *echo.Group) {
g.GET("/crawl/project/list", self.ProjectList)
g.POST("/crawl/project/query.html", self.ProjectQuery)
g.Match([]string{"GET", "POST"}, "/crawl/project/new", self.CrawlProject)
g.Match([]string{"GET", "POST"}, "/crawl/project/modify", self.Modify)
}
开发者ID:studygolang,项目名称:studygolang,代码行数:7,代码来源:project.go
示例7: RegisterRoute
// 注册路由
func (this *ArticleController) RegisterRoute(g *echo.Group) {
g.Get("/articles", this.ReadList)
g.Get("/articles/:id", this.Detail)
}
开发者ID:studygolang,项目名称:studygolang,代码行数:5,代码来源:article.go
示例8: registerUserHandlers
// User related endpoints
func registerUserHandlers(router *echo.Group, userService handler.UserService) {
router.Get("/users/:id", userService.Show)
router.Get("/users", userService.List)
router.Post("/users", userService.Create)
}
开发者ID:twanies,项目名称:gonzo,代码行数:6,代码来源:main.go
示例9: RegisterRoute
func (self ImageController) RegisterRoute(g *echo.Group) {
g.POST("/image/upload", self.Upload)
g.Match([]string{"GET", "POST"}, "/image/transfer", self.Transfer)
}
开发者ID:studygolang,项目名称:studygolang,代码行数:4,代码来源:image.go
示例10: RegisterRoute
// 注册路由
func (self InstallController) RegisterRoute(g *echo.Group) {
g.GET("/install", self.SetupConfig)
g.Match([]string{"GET", "POST"}, "/install/setup-config", self.SetupConfig)
g.Match([]string{"GET", "POST"}, "/install/do", self.DoInstall)
g.Match([]string{"GET", "POST"}, "/install/options", self.SetupOptions)
}
开发者ID:studygolang,项目名称:studygolang,代码行数:7,代码来源:install.go
示例11: RegisterRoute
// 注册路由
func (self ReadingController) RegisterRoute(g *echo.Group) {
g.GET("/reading/list", self.ReadingList)
g.POST("/reading/query.html", self.ReadingQuery)
g.Match([]string{"GET", "POST"}, "/reading/publish", self.Publish)
}
开发者ID:studygolang,项目名称:studygolang,代码行数:6,代码来源:reading.go
示例12: RegisterRoute
// 注册路由
func (self SearchController) RegisterRoute(g *echo.Group) {
g.GET("/search", self.Search)
}
开发者ID:studygolang,项目名称:studygolang,代码行数:4,代码来源:search.go
示例13: RegisterRoute
// 注册路由
func (self ReadingController) RegisterRoute(g *echo.Group) {
g.GET("/readings", self.ReadingList)
g.GET("/readings/:id", self.IReading)
}
开发者ID:studygolang,项目名称:studygolang,代码行数:5,代码来源:reading.go
示例14: APIRoutes
// APIRoutes definition
// ========== API ROUTES ======
func APIRoutes(api *echo.Group) {
// ======= ADMIN API ======
admin := controllers.AdminController{}
api.Get("/time", admin.GetTime)
posts := controllers.PostsController{}
api.GET("/posts/:id", posts.GetOne)
api.GET("/posts", posts.Get)
api.POST("/posts", posts.Save)
api.PUT("/posts/:id", posts.Update)
// CRUD /api/tags
tags := controllers.TagsController{}
api.GET("/tags/:id", tags.GetOne)
api.GET("/tags", tags.Get)
api.POST("/tags", tags.Save)
api.PUT("/tags/:id", tags.Update)
/* api.Delete("/tags/:id", tags.Destroy)
*/
}
开发者ID:mewben,项目名称:onix,代码行数:23,代码来源:main.go
示例15: RegisterRoute
// 注册路由
func (self LikeController) RegisterRoute(g *echo.Group) {
g.POST("/like/:objid", self.Like, middleware.NeedLogin())
}
开发者ID:studygolang,项目名称:studygolang,代码行数:4,代码来源:like.go
示例16: 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))
}
开发者ID:cedmundo,项目名称:hablo,代码行数:6,代码来源:sessions.go
示例17: RegisterRoute
// 注册路由
func (self TopicController) RegisterRoute(g *echo.Group) {
g.GET("/topics", self.Topics)
g.GET("/topics/no_reply", self.TopicsNoReply)
g.GET("/topics/last", self.TopicsLast)
g.GET("/topics/:tid", self.Detail)
g.GET("/topics/node/:nid", self.NodeTopics)
g.Match([]string{"GET", "POST"}, "/topics/new", self.Create, middleware.NeedLogin(), middleware.Sensivite(), middleware.PublishNotice())
g.Match([]string{"GET", "POST"}, "/topics/modify", self.Modify, middleware.NeedLogin(), middleware.Sensivite())
}
开发者ID:studygolang,项目名称:studygolang,代码行数:11,代码来源:topic.go
示例18: RegisterRoute
// 注册路由
func (self UserController) RegisterRoute(g *echo.Group) {
g.GET("/user/:username", self.Home)
g.GET("/users", self.ReadList)
g.Match([]string{"GET", "POST"}, "/user/email/unsubscribe", self.EmailUnsub)
}
开发者ID:studygolang,项目名称:studygolang,代码行数:6,代码来源:user.go
示例19: RegisterRoute
func (this *WebsocketController) RegisterRoute(g *echo.Group) {
g.GET("/ws", standard.WrapHandler(websocket.Handler(this.Ws)))
}
开发者ID:studygolang,项目名称:studygolang,代码行数:3,代码来源:websocket.go
示例20: Bind
// Bind attaches api routes
func (api *API) Bind(group *echo.Group) {
group.Get("/v1/conf", api.ConfHandler)
}
开发者ID:wavded,项目名称:go-starter-kit,代码行数:4,代码来源:api.go
注:本文中的github.com/labstack/echo.Group类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论