Documentation ¶
Overview ¶
Package v1 for interface UserRepository
Package v1 for endpoints with postgres
Index ¶
- type UserRepoPg
- func (u UserRepoPg) CreateUser(w http.ResponseWriter, r *http.Request)
- func (u UserRepoPg) DeleteUser(w http.ResponseWriter, r *http.Request)
- func (u UserRepoPg) GetUserByID(w http.ResponseWriter, r *http.Request)
- func (u UserRepoPg) GetUsers(w http.ResponseWriter, r *http.Request)
- func (u UserRepoPg) UpdateUser(w http.ResponseWriter, r *http.Request)
- type UserRepoSqlite
- func (u UserRepoSqlite) CreateUser(w http.ResponseWriter, r *http.Request)
- func (u UserRepoSqlite) DeleteUser(w http.ResponseWriter, r *http.Request)
- func (u UserRepoSqlite) GetUserByID(w http.ResponseWriter, r *http.Request)
- func (u UserRepoSqlite) GetUsers(w http.ResponseWriter, r *http.Request)
- func (u UserRepoSqlite) UpdateUser(w http.ResponseWriter, r *http.Request)
- type UserRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UserRepoPg ¶
type UserRepoPg struct {
// contains filtered or unexported fields
}
func NewUserRepositoryPg ¶
func (UserRepoPg) CreateUser ¶
func (u UserRepoPg) CreateUser(w http.ResponseWriter, r *http.Request)
CreateUser method for create new user @Summary Create user @Tags users @Description Create user @Param body body models.User true "body for user content" @Success 200 {object} models.IDInfo @Failure 400 @Failure 403 @Failure 500 @router /user [post]
func (UserRepoPg) DeleteUser ¶
func (u UserRepoPg) DeleteUser(w http.ResponseWriter, r *http.Request)
DeleteUser method for delete user @Summary Delete user @Tags users @Description Delete user @Param id path string true "user ID" @Success 204 @Failure 400 @Failure 403 @Failure 500 @router /user/{id} [delete]
func (UserRepoPg) GetUserByID ¶
func (u UserRepoPg) GetUserByID(w http.ResponseWriter, r *http.Request)
GetUserByID method for get user by id @Summary Get user by ID @Tags users @Description Get user by ID @Param id path string true "user ID" @Success 200 {object} models.User @Failure 400 @Failure 403 @Failure 500 @router /user/{id} [get]
func (UserRepoPg) GetUsers ¶
func (u UserRepoPg) GetUsers(w http.ResponseWriter, r *http.Request)
GetUsers method for get all users @Summary Get users @Tags users @Description Get users @Success 200 {object} models.Users @Failure 400 @Failure 403 @Failure 500 @router /user/list [get]
func (UserRepoPg) UpdateUser ¶
func (u UserRepoPg) UpdateUser(w http.ResponseWriter, r *http.Request)
UpdateUser method for update user @Summary Update user @Tags users @Description Update user @Param id path string true "user ID" @Param body body models.User true "body for user content" @Success 204 @Failure 400 @Failure 403 @Failure 500 @router /user/{id} [put]
type UserRepoSqlite ¶
type UserRepoSqlite struct {
// contains filtered or unexported fields
}
func NewUserRepositorySqlite ¶
func (UserRepoSqlite) CreateUser ¶
func (u UserRepoSqlite) CreateUser(w http.ResponseWriter, r *http.Request)
CreateUser method for create new user @Summary Create user @Tags users @Description Create user @Param body body models.User true "body for user content" @Success 200 {object} models.IDInfo @Failure 400 @Failure 403 @Failure 500 @router /user [post]
func (UserRepoSqlite) DeleteUser ¶
func (u UserRepoSqlite) DeleteUser(w http.ResponseWriter, r *http.Request)
DeleteUser method for delete user @Summary Delete user @Tags users @Description Delete user @Param id path string true "user ID" @Success 204 @Failure 400 @Failure 403 @Failure 500 @router /user/{id} [delete]
func (UserRepoSqlite) GetUserByID ¶
func (u UserRepoSqlite) GetUserByID(w http.ResponseWriter, r *http.Request)
GetUserByID method for get user by id @Summary Get user by ID @Tags users @Description Get user by ID @Param id path string true "user ID" @Success 200 {object} models.User @Failure 400 @Failure 403 @Failure 500 @router /user/{id} [get]
func (UserRepoSqlite) GetUsers ¶
func (u UserRepoSqlite) GetUsers(w http.ResponseWriter, r *http.Request)
GetUsers method for get all users @Summary Get users @Tags users @Description Get users @Success 200 {object} models.Users @Failure 400 @Failure 403 @Failure 500 @router /user/list [get]
func (UserRepoSqlite) UpdateUser ¶
func (u UserRepoSqlite) UpdateUser(w http.ResponseWriter, r *http.Request)
UpdateUser method for update user @Summary Update user @Tags users @Description Update user @Param id path string true "user ID" @Param body body models.User true "body for user content" @Success 204 @Failure 400 @Failure 403 @Failure 500 @router /user/{id} [put]
type UserRepository ¶
type UserRepository interface { CreateUser(w http.ResponseWriter, r *http.Request) GetUserByID(w http.ResponseWriter, r *http.Request) GetUsers(w http.ResponseWriter, r *http.Request) UpdateUser(w http.ResponseWriter, r *http.Request) DeleteUser(w http.ResponseWriter, r *http.Request) }