Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrUnableToReadContentLength = errors.New("Unable to read content length") ErrUnableToReadPayload = errors.New("Unable to read payload content") )
Functions ¶
func InitAPI ¶
InitAPI generate an API v1 entry
@title API to learn how to use swagger and echo @version 1.0 @description The following project helps to learn echo and how to attach swagger to it. @license.name Mozilla Public License 2.0 @license.url https://www.mozilla.org/en-US/MPL/2.0/ @produce json @accept json @schemes http @BasePath /v1
Types ¶
type APIv1 ¶
type APIv1 struct {
// contains filtered or unexported fields
}
APIv1 supporting internal details
func (*APIv1) CreateUser ¶
CreateUser is the Exported API request to create a user
@Summary Create a new user. @Description Create a new user and returns it's record on success. @Tags Users @Accept json @Produce json @Param user_details body structs.User true "User object" @Success 200 {object} models.Users "User details as returned by the saved record" @Failure 400 {object} structs.HTTPError "Something in the request is wrong/unexpected" @Failure 500 {object} structs.HTTPError "Something in internal operation was bad" @Router /users/add [put]
func (*APIv1) GetUserByID ¶
GetUserByID finds a user by a given user id.
@Summary Finds a user by a given user id, and returning the record @Description Finds a user by a given user id, and returning the record @Tags Users @Accept json @Produce json @Param id path int true "User ID" @Success 200 {object} models.Users "User details as returned by the saved record" @Failure 400 {object} structs.HTTPError "Something in the request is wrong/unexpected" @Failure 404 {object} structs.HTTPError "User was not found by provided ID" @Failure 500 {object} structs.HTTPError "Something in internal operation was bad" @Router /users/get/by_id/{id} [GET]