Documentation
¶
Index ¶
- type ChangePasswordRequest
- type OrderDBModel
- type PaymentDBModel
- type Plan
- type Roles
- type SignInUserRequest
- type SignUpUserRequest
- type StringInterfaceMap
- type SubscriptionDBModel
- type UpdateUserRequest
- type User
- type UserDBModel
- type UserDBResponse
- type UserEvent
- type UserMongoModel
- type UserRedisModel
- type UserRequest
- type UserResponse
- func (r *UserResponse) AssignTokenPair(tp *jwt.TokenPair)
- func (r *UserResponse) FromDBModel(um *UserDBModel) error
- func (r *UserResponse) FromDBResponse(user *UserDBResponse) error
- func (r *UserResponse) FromProtoSignIn(pbu *intrvproto.SignInUserResponse)
- func (r *UserResponse) FromProtoSignUp(pbu *intrvproto.SignUpUserResponse) error
- func (r *UserResponse) FromProtoUserDetails(pbu *intrvproto.UserDetails)
- func (r *UserResponse) FromProtoUserResponse(pu *intrvproto.UserResponse) error
- type Users
- type VerificationCodeRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChangePasswordRequest ¶
type OrderDBModel ¶
type OrderDBModel struct {
Id int64 `gorm:"id;primaryKey;autoIncrement"`
UserId int64 `gorm:"column:user_id;type:int;not null;uniqueIndex;not null"`
SubscriptionId int64 `gorm:"column:plan_id;type:varchar(255);not null"`
VoucherId int64
PurchasedAt time.Time `gorm:"column:purchased_at"`
CreatedAt time.Time `gorm:"column:created_at"`
DeletedAt *time.Time `gorm:"column:deleted_at"`
}
func (OrderDBModel) TableName ¶
func (OrderDBModel) TableName() string
type PaymentDBModel ¶
type PaymentDBModel struct {
Id int64 `gorm:"id;primaryKey;autoIncrement"`
UserId int64 `gorm:"column:user_id;type:int;not null;uniqueIndex;not null"`
PlanId int64 `gorm:"column:plan_id;type:varchar(255);not null"`
OrderId int64 `gorm:"column:order_id;type:int;not null"`
Total int64 `gorm:"column:total;type:int;not null"`
PurchasedAt time.Time `gorm:"column:purchased_at"`
StartedAt *time.Time `gorm:"column:started_at"`
EndsAt *time.Time `gorm:"column:ends_at"`
}
func (PaymentDBModel) TableName ¶
func (PaymentDBModel) TableName() string
type Plan ¶
type Plan struct {
Id int64 `gorm:"id;primaryKey;autoIncrement"`
Name int64 `gorm:"column:user_id;type:int;not null;uniqueIndex;not null"`
Description int64 `gorm:"column:plan_id;type:varchar(255);not null"`
IsActive bool `gorm:"column:is_active;type:bool;not null"`
CreatedAt time.Time `gorm:"column:created_at"`
UpdatedAt *time.Time `gorm:"column:updated_at"`
DeletedAt *time.Time `gorm:"column:deleted_at"`
}
type SignInUserRequest ¶
type SignUpUserRequest ¶
type StringInterfaceMap ¶
type StringInterfaceMap map[string]interface{}
func (*StringInterfaceMap) Scan ¶
func (m *StringInterfaceMap) Scan(src interface{}) error
type SubscriptionDBModel ¶
type SubscriptionDBModel struct {
Id int64 `gorm:"id;primaryKey;autoIncrement"`
UserId int64 `gorm:"column:user_id;type:int;not null;uniqueIndex;not null"`
PlanId int64 `gorm:"column:plan_id;type:varchar(255);not null"`
PurchasedAt time.Time `gorm:"column:purchased_at"`
StartedAt time.Time `gorm:"column:started_at"`
EndsAt time.Time `gorm:"column:ends_at"`
}
func (SubscriptionDBModel) TableName ¶
func (SubscriptionDBModel) TableName() string
type UpdateUserRequest ¶
type User ¶
type User struct {
ID int64
// Creates a primary key for UserID.
UserID int64 `gorm:"primary_key"`
Username string `sql:"type:VARCHAR(15);not null"`
FName string `sql:"size:100;not null" gorm:"column:FirstName"`
LName string `sql:"unique;unique_index;not null;DEFAULT:'Unknown'" gorm:"column:LastName"`
Count int `gorm:"AUTO_INCREMENT"`
TempField bool `sql:"-"` // Ignore a Field
}
type UserDBModel ¶
type UserDBModel struct {
Id int64 `gorm:"id;primaryKey;autoIncrement"`
Username string `gorm:"type:varchar(180);not null;uniqueIndex;not null"`
Password string `gorm:"type:varchar(255);not null"`
Firstname string `gorm:"column:first_name;type:varchar(255)"`
Lastname string `gorm:"column:last_name;type:varchar(255)"`
Email string `gorm:"type:varchar(255);not null;uniqueIndex;not null"`
Phone string `gorm:"column:phone_no;type:varchar(11)"`
VerificationCode string `gorm:"column:verification_code;type:varchar(12)"`
Roles StringInterfaceMap `gorm:"column:roles;type:json"`
CreatedAt time.Time `gorm:"column:created_at"`
UpdatedAt *time.Time `gorm:"column:updated_at"`
LastLogin *time.Time `gorm:"column:last_login"`
DeletedAt *time.Time `gorm:"column:deleted_at"`
Verified bool `gorm:"column:is_verified;default:false"`
Active bool `gorm:"column:is_active;default:false"`
}
func (*UserDBModel) AMQP ¶
func (um *UserDBModel) AMQP() *amqp.Publishing
func (*UserDBModel) BeforeCreate ¶
func (um *UserDBModel) BeforeCreate(tx *gorm.DB) (err error)
func (*UserDBModel) FromCreateUserReq ¶
func (m *UserDBModel) FromCreateUserReq(cur SignUpUserRequest, enc ...bool) error
func (*UserDBModel) FromMongoUser ¶
func (um *UserDBModel) FromMongoUser(um2 *UserMongoModel) error
func (UserDBModel) TableName ¶
func (UserDBModel) TableName() string
type UserDBResponse ¶
type UserDBResponse struct {
Id int64
Username string
Firstname string
Lastname string
Email string
Password string
Verified bool
Active bool
CreatedAt time.Time
LastLogin time.Time
}
func (*UserDBResponse) FromProtoUserDetails ¶
func (r *UserDBResponse) FromProtoUserDetails(pw *intrvproto.UserDetails) error
type UserMongoModel ¶
type UserMongoModel struct {
Username string `bson:"username,omitempty"`
Password string `bson:"password,omitempty"`
Firstname string `bson:"firstname,omitempty"`
Lastname string `bson:"lastname,omitempty"`
Email string `bson:"email,omitempty"`
Phone string `bson:"phone,omitempty"`
VerificationCode string `bson:"verification_code,omitempty"`
Verified bool `bson:"is_verified,omitempty"`
Active bool `bson:"is_active,omitempty"`
Roles Roles `bson:"roles,omitempty"`
CreatedAt time.Time `bson:"createdAt,omitempty"`
UpdatedAt *time.Time `bson:"updatedAt,omitempty"`
LastLogin *time.Time `bson:"lastLogin,omitempty"`
}
func (*UserMongoModel) FromDBModel ¶
func (m *UserMongoModel) FromDBModel(user *UserDBModel) error
type UserRedisModel ¶
type UserRedisModel struct {
Id int64 `json:"id"`
Firstname string `json:"first_name"`
Lastname string `json:"last_name"`
Email string `json:"email"`
Phone string `json:"phone_no"`
VerificationCode string `json:"verification_code"`
Roles StringInterfaceMap `json:"roles"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt *time.Time `json:"updated_at"`
LastLogin *time.Time `json:"last_login"`
DeletedAt *time.Time `json:"deleted_at"`
Verified bool `json:"is_verified"`
Active bool `json:"is_active"`
}
func (*UserRedisModel) FromDbModel ¶
func (m *UserRedisModel) FromDbModel(user *UserDBModel)
type UserRequest ¶
type UserResponse ¶
type UserResponse struct {
Id int64 `json:"id,omitempty"`
Username string `json:"username,omitempty"`
Firstname string `json:"firstname,omitempty"`
Lastname string `json:"lastname,omitempty"`
Email string `json:"email,omitempty"`
Verified bool `json:"is_verified,omitempty"`
VerificationCode string `json:"verification_token,omitempty"`
Active bool `json:"is_active,omitempty"`
AccessToken string `json:"token,omitempty"`
RefreshToken string `json:"refresh_token,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
LastLogin *time.Time `json:"last_login,omitempty"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
}
func (*UserResponse) AssignTokenPair ¶
func (r *UserResponse) AssignTokenPair(tp *jwt.TokenPair)
func (*UserResponse) FromDBModel ¶
func (r *UserResponse) FromDBModel(um *UserDBModel) error
func (*UserResponse) FromDBResponse ¶
func (r *UserResponse) FromDBResponse(user *UserDBResponse) error
func (*UserResponse) FromProtoSignIn ¶
func (r *UserResponse) FromProtoSignIn(pbu *intrvproto.SignInUserResponse)
func (*UserResponse) FromProtoSignUp ¶
func (r *UserResponse) FromProtoSignUp(pbu *intrvproto.SignUpUserResponse) error
func (*UserResponse) FromProtoUserDetails ¶
func (r *UserResponse) FromProtoUserDetails(pbu *intrvproto.UserDetails)
func (*UserResponse) FromProtoUserResponse ¶
func (r *UserResponse) FromProtoUserResponse(pu *intrvproto.UserResponse) error
type Users ¶
type Users struct {
Users []UserDBModel `json:"users"`
}
type VerificationCodeRequest ¶
type VerificationCodeRequest struct {
Email string `json:"email" validate:"required,email"`
}
Click to show internal directories.
Click to hide internal directories.