当前位置: 首页>>代码示例>>Golang>>正文


Golang Group.Get方法代码示例

本文整理汇总了Golang中github.com/labstack/echo.Group.Get方法的典型用法代码示例。如果您正苦于以下问题:Golang Group.Get方法的具体用法?Golang Group.Get怎么用?Golang Group.Get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在github.com/labstack/echo.Group的用法示例。


在下文中一共展示了Group.Get方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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))
}
开发者ID:cedmundo,项目名称:hablo,代码行数:8,代码来源:profiles.go

示例2: RegisterRoute

// 注册路由
func (self AccountController) RegisterRoute(g *echo.Group) {
	g.Any("/account/register", self.Register)
	g.Post("/account/send_activate_email", self.SendActivateEmail)
	g.Get("/account/activate", self.Activate)
	g.Any("/account/login", self.Login)
	g.Any("/account/edit", self.Edit, middleware.NeedLogin())
	g.Post("/account/change_avatar", self.ChangeAvatar, middleware.NeedLogin())
	g.Post("/account/changepwd", self.ChangePwd, middleware.NeedLogin())
	g.Any("/account/forgetpwd", self.ForgetPasswd)
	g.Any("/account/resetpwd", self.ResetPasswd)
	g.Get("/account/logout", self.Logout, middleware.NeedLogin())
}
开发者ID:studygolang,项目名称:studygolang,代码行数:13,代码来源:account.go

示例3: 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))
}
开发者ID:cedmundo,项目名称:hablo,代码行数:14,代码来源:groups.go

示例4: 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

示例5: RegisterRoute

// 注册路由
func (self FavoriteController) RegisterRoute(g *echo.Group) {
	g.Post("/favorite/:objid", self.Create, middleware.NeedLogin())
	g.Get("/favorites/:username", self.ReadList)
}
开发者ID:studygolang,项目名称:studygolang,代码行数:5,代码来源:favorite.go

示例6: 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

示例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 CommentController) RegisterRoute(g *echo.Group) {
	g.Get("/at/users", self.AtUsers)
	g.Post("/comment/:objid", self.Create, middleware.NeedLogin(), middleware.Sensivite(), middleware.PublishNotice())
	g.Get("/object/comments", self.CommentList)
}
开发者ID:studygolang,项目名称:studygolang,代码行数:5,代码来源:comment.go

示例10: RegisterRoute

func (self CaptchaController) RegisterRoute(g *echo.Group) {
	g.Get("/captcha/*", self.Server)
}
开发者ID:studygolang,项目名称:studygolang,代码行数:3,代码来源:captcha.go


注:本文中的github.com/labstack/echo.Group.Get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。