Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthToken ¶
type AuthToken struct {
AccessToken string `json:"access_token,omitempty"`
TokenType string `json:"token_type,omitempty"`
ExpiresIn int `json:"expires_in,omitempty"`
RefreshToken string `json:"refresh_token,omitempty"`
}
AuthToken holds authentication token details with refresh token swagger:model
type Base ¶
type Base struct {
// ID of the record
ID string `json:"id" gorm:"primaryKey"`
// The time that record is created
CreatedAt time.Time `json:"created_at"`
// The latest time that record is updated
UpdatedAt time.Time `json:"updated_at"`
}
Base contains common fields for all models
type Memo ¶
type Memo struct {
Base
UserID string `json:"-" gorm:"not null"`
Content string `json:"memo" gorm:"type:text"`
}
Memo represents the memo model swagger:model
type Session ¶
type Session struct {
ID string `json:"id" gorm:"primaryKey"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
UserID string `json:"user_id"`
IsBlocked bool `json:"is_blocked" gorm:"default:false"`
ExpiresAt time.Time `json:"expires_at" gorm:"type:datetime(3)"`
IPAddress string `json:"ip_address"`
UserAgent string `json:"user_agent"`
RefreshToken sql.NullString `json:"-" gorm:"uniqueIndex:uix_users_refresh_token"`
User *User `json:"user,omitempty" gorm:"foreignKey:UserID"`
}
Session represents the session model swagger:model
type User ¶
type User struct {
Base
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
Role string `json:"role"`
Password string `json:"-" gorm:"not null"`
LastLogin *time.Time `json:"last_login,omitempty" gorm:"type:datetime(3)"`
Phone string `json:"phone" gorm:"uniqueIndex:uix_users_phone"`
PhoneVerifiedAt *time.Time `json:"phone_verified_at,omitempty" gorm:"type:datetime(3)"`
OTP *string `json:"-" gorm:"varchar(10)"`
OTPSentAt *time.Time `json:"-" gorm:"type:datetime(3)"`
Email string `json:"email" gorm:"uniqueIndex:uix_users_email"`
EmailVerifiedAt *time.Time `json:"email_verified_at,omitempty" gorm:"type:datetime(3)"`
Status string `json:"status" gorm:"type:varchar(20);default:active"` // active || blocked || deleted
}
User represents the user model swagger:model
Click to show internal directories.
Click to hide internal directories.