Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var UserSortMap map[mo.UserSortField]string = map[mo.UserSortField]string{ mo.UserSortFieldId: "id", mo.UserSortFieldName: "name", mo.UserSortFieldCreatedAt: "created_at", mo.UserSortFieldUpdatedAt: "updated_at", }
Functions ¶
This section is empty.
Types ¶
type User ¶
type User struct { tgorm.Model UserName string `json:"user_name" gorm:"not null;default:''"` // UserName is the user name of the user. Email string `json:"email" gorm:"not null;default:''"` // Email is the email address of the user. Role string `json:"role" gorm:"not null;default:''"` // Role is the role of the user. UserType int `json:"user_type" gorm:"not null;default:0"` // UserType is the type of the user. UserStatus int `json:"user_status" gorm:"not null;default:0"` // UserStatus is the status of the user. Tags pq.StringArray `json:"tags" gorm:"type:text[]"` // Tags is the tags of the user. FirstName string `json:"first_name" gorm:"not null;default:''"` // FirstName is the first name of the user. LastName string `json:"last_name" gorm:"not null;default:''"` // FirstName is the last name of the user. }
User is a struct that represents the db mapper of a user basic values.
func NewUser ¶
func NewUser(id uuid.UUID, userName string, email string, role string, userType int, userStatus int, tags pq.StringArray, firstName string, lastName string) *User
NewUser creates a new *User.
func NewUserFromEntity ¶
NewUserFromEntity creates a new *User from entity.
type UserPassword ¶
type UserPassword struct { tgorm.Model UserID uuid.UUID `json:"user_id" gorm:"type:uuid;default:uuid_nil()"` // UserId is the id of the user. Password string `json:"password" gorm:"not null"` // Password is the password of the user. PasswordStatus int `json:"password_status" gorm:"not null;default:0"` // PasswordStatus is the status of password of the user. }
UserPassword is a struct that represents the db mapper of a user password values.
func NewUserPassword ¶
func NewUserPassword(id uuid.UUID, userId uuid.UUID, password string, paswordStatus int) *UserPassword
NewUserPassword creates a new *UserPassword.
func NewUserPasswordFromEntity ¶
func NewUserPasswordFromEntity(entity me.UserPassword) *UserPassword
NewUserPasswordFromEntity creates a new *UserPassword from entity.
func (*UserPassword) String ¶
func (s *UserPassword) String() string
String returns a string representation of the UserPassword.
func (*UserPassword) ToEntity ¶
func (s *UserPassword) ToEntity() *me.UserPassword
ToEntity returns a entity representation of the UserPassword.
type UserPasswords ¶
type UserPasswords []*UserPassword
func NewUserPasswordFromEntities ¶
func NewUserPasswordFromEntities(entities []me.UserPassword) UserPasswords
NewUserPasswordsFromEntities creates a new []*UserPassword from entities.
func (UserPasswords) ToEntities ¶
func (s UserPasswords) ToEntities() []me.UserPassword
ToEntities creates a new []me.UserPassword entity.
Click to show internal directories.
Click to hide internal directories.