infrastructure

package
v0.0.0-...-436674b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

func NewUserFromEntity(entity me.User) *User

NewUserFromEntity creates a new *User from entity.

func (*User) String

func (s *User) String() string

String returns a string representation of the User.

func (*User) ToEntity

func (s *User) ToEntity() *me.User

ToEntity returns a entity representation of the User.

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.

type Users

type Users []*User

func NewUserFromEntities

func NewUserFromEntities(entities []me.User) Users

NewUsersFromEntities creates a new []*User from entities.

func (Users) ToEntities

func (s Users) ToEntities() []me.User

ToEntities creates a new []me.User entity.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL