Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteUser ¶
func HandleCreateUser ¶
func HandleCreateUser(w http.ResponseWriter, r *http.Request)
HandleCreateUser godoc @Summary Create a new user @Description Registers a new user in the system @Tags users @Accept json @Produce json @Param user body UserCreateRequest true "User creation payload" @Success 201 {object} UserResponse @Failure 400 {object} model.ApiError @Failure 500 {object} model.ApiError @Router /users/create [post]
func UpdateUser ¶
func ValidateUserCreateRequest ¶
func ValidateUserCreateRequest(input UserCreateRequest) error
Types ¶
type ApiUserResponse ¶
type ApiUserResponse struct {
Data *UserResponse `json:"data,omitempty"`
Error *model.ApiError `json:"error,omitempty"`
}
ApiUserResponse is used for Swagger documentation
type User ¶
func AuthenticateUser ¶
AuthenticateUser checks if the provided username and password match a user in the database. It returns the user details if the credentials are valid, otherwise an error.
type UserCreateRequest ¶
type UserResponse ¶
func CreateUser ¶
func CreateUser(username, password, email string) (*UserResponse, error)
Click to show internal directories.
Click to hide internal directories.