示例#1
0
// 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
0
文件: groups.go 项目: cedmundo/hablo
// 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
0
// 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
0
// ConfigureHTTPGroup setups the websocket listener
func ConfigureHTTPGroup(g *echo.Group) {
	g.Use(auth.AnyAuth())
	g.WebSocket("", msg.JSONResource(AcceptClient))
}