Пример #1
0
// Retrieve returns the specified user from the system.
// 200 Success, 400 Bad Request, 404 Not Found, 500 Internal
func (usersHandle) Retrieve(c *app.Context) error {
	u, err := services.Users.Retrieve(c, c.Params["id"])
	if err != nil {
		return err
	}

	c.Respond(u, http.StatusOK)
	return nil
}
Пример #2
0
// List returns all the existing users in the system.
// 200 Success, 404 Not Found, 500 Internal
func (usersHandle) List(c *app.Context) error {
	u, err := services.Users.List(c)
	if err != nil {
		return err
	}

	c.Respond(u, http.StatusOK)
	return nil
}