Documentation ¶
Index ¶
- Constants
- Variables
- type GetAllUserRepositoryResponse
- type PaginationRequest
- type PaginationResponse
- type SendVerificationEmailRequest
- type UpdateStatusIsVerifiedRequest
- type UserCreateRequest
- type UserLoginRequest
- type UserLoginResponse
- type UserPaginationResponse
- type UserResponse
- type UserUpdateRequest
- type UserUpdateResponse
- type VerifyEmailRequest
- type VerifyEmailResponse
Constants ¶
View Source
const ( // Failed MESSAGE_FAILED_GET_DATA_FROM_BODY = "failed get data from body" MESSAGE_FAILED_REGISTER_USER = "failed create user" MESSAGE_FAILED_GET_LIST_USER = "failed get list user" MESSAGE_FAILED_GET_USER_TOKEN = "failed get user token" MESSAGE_FAILED_TOKEN_NOT_VALID = "token not valid" MESSAGE_FAILED_TOKEN_NOT_FOUND = "token not found" MESSAGE_FAILED_GET_USER = "failed get user" MESSAGE_FAILED_LOGIN = "failed login" MESSAGE_FAILED_WRONG_EMAIL_OR_PASSWORD = "wrong email or password" MESSAGE_FAILED_UPDATE_USER = "failed update user" MESSAGE_FAILED_DELETE_USER = "failed delete user" MESSAGE_FAILED_PROSES_REQUEST = "failed proses request" MESSAGE_FAILED_DENIED_ACCESS = "denied access" MESSAGE_FAILED_VERIFY_EMAIL = "failed verify email" // Success MESSAGE_SUCCESS_REGISTER_USER = "success create user" MESSAGE_SUCCESS_GET_LIST_USER = "success get list user" MESSAGE_SUCCESS_GET_USER = "success get user" MESSAGE_SUCCESS_LOGIN = "success login" MESSAGE_SUCCESS_UPDATE_USER = "success update user" MESSAGE_SUCCESS_DELETE_USER = "success delete user" MESSAGE_SEND_VERIFICATION_EMAIL_SUCCESS = "success send verification email" MESSAGE_SUCCESS_VERIFY_EMAIL = "success verify email" )
Variables ¶
View Source
var ( ErrCreateUser = errors.New("failed to create user") ErrGetAllUser = errors.New("failed to get all user") ErrGetUserById = errors.New("failed to get user by id") ErrGetUserByEmail = errors.New("failed to get user by email") ErrEmailAlreadyExists = errors.New("email already exist") ErrUpdateUser = errors.New("failed to update user") ErrUserNotAdmin = errors.New("user not admin") ErrUserNotFound = errors.New("user not found") ErrEmailNotFound = errors.New("email not found") ErrDeleteUser = errors.New("failed to delete user") ErrPasswordNotMatch = errors.New("password not match") ErrEmailOrPassword = errors.New("wrong email or password") ErrAccountNotVerified = errors.New("account not verified") ErrTokenInvalid = errors.New("token invalid") ErrTokenExpired = errors.New("token expired") ErrAccountAlreadyVerified = errors.New("account already verified") )
Functions ¶
This section is empty.
Types ¶
type GetAllUserRepositoryResponse ¶
type GetAllUserRepositoryResponse struct { Users []entity.User PaginationResponse }
type PaginationRequest ¶
type PaginationRequest struct { Search string `form:"search"` Page int `form:"page"` PerPage int `form:"per_page"` }
func (*PaginationRequest) GetOffset ¶
func (p *PaginationRequest) GetOffset() int
type PaginationResponse ¶
type PaginationResponse struct { Page int `json:"page"` PerPage int `json:"per_page"` MaxPage int64 `json:"max_page"` Count int64 `json:"count"` }
func (*PaginationResponse) GetLimit ¶
func (p *PaginationResponse) GetLimit() int
func (*PaginationResponse) GetPage ¶
func (p *PaginationResponse) GetPage() int
type SendVerificationEmailRequest ¶
type SendVerificationEmailRequest struct {
Email string `json:"email" form:"email" binding:"required"`
}
type UserCreateRequest ¶
type UserLoginRequest ¶
type UserLoginResponse ¶
type UserPaginationResponse ¶
type UserPaginationResponse struct { Data []UserResponse `json:"data"` PaginationResponse }
type UserResponse ¶
type UserUpdateRequest ¶
type UserUpdateResponse ¶
type VerifyEmailRequest ¶
type VerifyEmailRequest struct {
Token string `json:"token" form:"token" binding:"required"`
}
type VerifyEmailResponse ¶
Click to show internal directories.
Click to hide internal directories.