Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateKeyCacheForgotPassword(userID uint64, requestID string) string
- func GenerateKeyCacheOtp(userID uint64, requestID string) string
- func GenerateKeyCacheUserDetail(userID uint64) string
- func GenerateMessageEmailVerify(userName, otp string, expired time.Duration) string
- func GenerateMessagePasswordReset(userName, otp string, expired time.Duration) string
- type BasedFilter
- type DefaultModel
- type Log
- type User
- type UserRelation
Constants ¶
View Source
const ( TRUE = "true" FALSE = "false" // Default ... DefaultPage = 1 DefaultLimit = 10 DefaultLimitIsTotalDataTrue = 20 // OrderBy ... OrderByASC = "ASC" OrderByDESC = "DESC" )
View Source
const ( SubjectEmailVerify = "Verify Your Email Address" SubjectPasswordReset = "Reset Your Password" )
View Source
const ( Updated = `Updated` Deleted = `Deleted` Created = `Created` Read = `Read` )
View Source
const ( ROOT = `ROOT` ADMIN = `ADMIN` USER = `USER` )
View Source
const (
ALL = `ALL`
)
View Source
const (
QueueInsertLog = "insert_log"
)
View Source
const (
TimeDurationZero = time.Duration(0) * time.Second
)
Variables ¶
View Source
var ( IsValidOrderBy = map[string]bool{ OrderByASC: true, OrderByDESC: true, } )
View Source
var ( QueueList = []string{ QueueInsertLog, } )
Functions ¶
func GenerateKeyCacheOtp ¶
func GenerateMessageEmailVerify ¶
GenerateMessageEmailVerify generates the message for email verification
Types ¶
type BasedFilter ¶
type BasedFilter struct { Limit int `json:"limit" form:"limit"` Offset int `json:"offset" form:"offset"` Page int `json:"page" form:"page"` OrderBy string `json:"order_by" form:"order_by"` SortBy string `json:"sort_by" form:"sort_by"` IsNoLimit bool `json:"is_no_limit" form:"is_no_limit"` IsNotDefaultQuery bool `json:"is_not_default_query" form:"is_not_default_query"` CustomColumns string `json:"custom_columns" form:"custom_columns"` }
func (*BasedFilter) DefaultQuery ¶
func (c *BasedFilter) DefaultQuery() BasedFilter
type DefaultModel ¶
type Log ¶
type Log struct { ID uint64 `json:"id" gorm:"primaryKey"` Name string `json:"name" gorm:"not null"` Action string `json:"action" gorm:"not null"` TableNameID uint64 `json:"table_name_id"` TableName string `json:"table_name"` UserID uint64 `json:"user_id"` LogDateTime time.Time `json:"log_date_time"` User UserRelation `json:"user" gorm:"ForeignKey:UserID"` DefaultModel }
Log represents the model for an log
type User ¶
type User struct { ID uint64 `json:"id" gorm:"primaryKey"` Name string `json:"name" gorm:"not null"` Role string `json:"role" gorm:"not null;default:'USER'"` Username string `json:"username" gorm:"not null;uniqueIndex"` Email string `json:"email" gorm:"not null;uniqueIndex"` EmailVerifiedAt *time.Time `json:"email_verified_at" gorm:"null; default:null"` Password string `json:"password,omitempty" gorm:"not null"` Salt string `json:"salt,omitempty" gorm:"not null"` DefaultModel }
User represents the model for an user
func (*User) ConvertToResponse ¶
func (u *User) ConvertToResponse()
type UserRelation ¶
type UserRelation struct { ID uint64 `json:"id"` Name string `json:"name"` Role string `json:"role"` Email string `json:"email"` }
func (UserRelation) TableName ¶
func (UserRelation) TableName() string
Click to show internal directories.
Click to hide internal directories.