Exemplo n.º 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))
}
Exemplo n.º 2
0
// 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))
}
Exemplo n.º 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))
}
Exemplo n.º 4
0
// ConfigureHTTPGroup setups the websocket listener
func ConfigureHTTPGroup(g *echo.Group) {
	g.Use(auth.AnyAuth())
	g.WebSocket("", msg.JSONResource(AcceptClient))
}