Documentation
¶
Index ¶
- Constants
- func GetRoleName(role UserRole) string
- type CaptureFields
- type Claims
- type CreateUserReq
- type CreateUserResponse
- type CustomErrorResponse
- type CustomErrorResponseWithMeta
- type ErrorResponse
- type GeneralResponse
- type Log
- type LogType
- type LoginReq
- type LoginResponse
- type TodoListReq
- type TodoListResponse
- type UserRole
- type ValidationError
Constants ¶
View Source
const ( GeneralLogFilePath = "/storage/log/general" WorkerLogFilePath = "/storage/log/worker" )
View Source
const ( SUCCESS_CODE = "00" SUCCESS_MSG = "Success" INVALID_AUTH_CODE = "01" INVALID_AUTH_MSG = "Invalid Email or Password" INVALID_PAYLOAD_CODE = "02" INVALID_PAYLOAD_MSG = "Invalid Payload Request Data" INVALID_TOKEN_CODE = "05" INVALID_TOKEN_MSG = "Invalid Access Token" BAD_REQUEST_CODE = "30" BAD_REQUEST_MSG = "Bad Request" DATA_NOT_FOUND_MSG = "Data not found" USER_NOT_FOUND_MSG = "User not found" GENERAL_ERROR_MESSAGE = "Something went wrong. Please try again later." )
View Source
const (
PRODUCTION_ENV = "production"
)
View Source
const (
VALIDATE_CUSTOM_EXAMPLE = "validate_custom_example"
)
Variables ¶
This section is empty.
Functions ¶
func GetRoleName ¶
Types ¶
type CaptureFields ¶
type Claims ¶
type Claims struct {
jwt.RegisteredClaims
UserID int64 `json:"user_id"`
Email string `json:"email"`
RoleAccess int8 `json:"role"`
}
type CreateUserReq ¶
type CreateUserReq struct {
Name string `json:"name" validate:"required" name:"Nama"`
Email string `json:"email" validate:"required"`
Password string `json:"password" validate:"required"`
ReenterPassword string `json:"reenter_password" validate:"required"`
Phone string `json:"phone" validate:"required" name:"Nomor Telepon"`
RoleAccess int8 `json:"role_access" validate:"required" name:"Hak Akses"`
}
type CreateUserResponse ¶
type CustomErrorResponse ¶
type CustomErrorResponseWithMeta ¶
type CustomErrorResponseWithMeta struct {
Message string `json:"message,omitempty"`
ErrCode string `json:"code,omitempty"`
HTTPCode int `json:"http_code"`
Meta []ErrorResponse `json:"meta,omitempty"`
}
type ErrorResponse ¶
type GeneralResponse ¶
type Log ¶
type Log struct {
FuncName string `json:"func_name"`
Message string `json:"message"`
ErrorMessage string `json:"error_message"`
Process string `json:"process"`
Status LogType `json:"status"`
LogFields CaptureFields `json:"capture_fields"`
}
func (*Log) LoadFromMap ¶
type LoginResponse ¶
type TodoListReq ¶
type TodoListReq struct {
ID int64 `json:"id,omitempty" swaggerignore:"true"`
UserID int64 `json:"user_id,omitempty" validate:"required"`
Title string `json:"title,omitempty" validate:"required" name:"Judul"`
Description string `json:"description" validate:"required" name:"Deskripsi"`
DoingAt string `json:"doing_at" validate:"required" name:"Tanggal Aktifitas"`
}
func (*TodoListReq) SetID ¶
func (r *TodoListReq) SetID(ID int64)
func (*TodoListReq) SetUserID ¶
func (r *TodoListReq) SetUserID(UserID int64)
type TodoListResponse ¶
type ValidationError ¶
Click to show internal directories.
Click to hide internal directories.