domain

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: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogData

type LogData struct {
	Id            uuid.UUID `json:"id"` // Id is the id of the log.
	*pb.LogHeader           // LogHeader is the header of the log.
	*pb.LogBody             // LogBody is the body of the log.
}

LogData is a struct that represents the entity of a log.

func NewLogData

func NewLogData() *LogData

NewLogData creates a new *LogData.

func (*LogData) GenerateLogData

func (s *LogData) GenerateLogData(logType pb.LogType,
	path string,
	userId string,
	message string) *pb.LogData

GenerateLogData generated a new *pb.LogData

func (*LogData) String

func (s *LogData) String() string

String returns a string representation of the LogData.

type User

type User struct {
	Id      uuid.UUID `json:"id"` // Id is the id of the user.
	mo.User           // User is the basic values of the user.

	// Only for view
	CreatedAt time.Time `json:"created_at"` // CreatedAt is the create time.
	UpdatedAt time.Time `json:"updated_at"` // UpdatedAt is the update time.
}

User is a struct that represents the entity of a user basic values.

func NewEmptyUser

func NewEmptyUser() *User

NewEmptyUser creates a new *User with empty values.

func NewUser

func NewUser(id uuid.UUID,
	user mo.User) *User

NewUser creates a new *User.

func (*User) Clear

func (s *User) Clear()

Clear clears the User.

func (*User) Clone

func (s *User) Clone() *User

Clone returns a clone of the User.

func (*User) Equals

func (s *User) Equals(other *User) bool

Equals returns true if the User is equal to the other User.

func (*User) IsEmpty

func (s *User) IsEmpty() bool

IsEmpty returns true if the User is empty.

func (*User) IsNotEmpty

func (s *User) IsNotEmpty() bool

IsNotEmpty returns true if the User is not empty.

func (*User) String

func (s *User) String() string

String returns a string representation of the User.

func (*User) Validate

func (s *User) Validate() error

Validate validates the User.

type UserFilter

type UserFilter struct {
	Id         uuid.UUID     `json:"id"`          // Id is the id of the user.
	UserName   string        `json:"user_name"`   // UserName is the user name of the user.
	Email      string        `json:"email"`       // Email is the email address of the user.
	UserType   mo.UserType   `json:"user_type"`   // UserType is the type of the user.
	UserStatus mo.UserStatus `json:"user_status"` // UserStatus is the status of the user.
	Tags       []string      `json:"tags"`        // Tags is the tags of the user.
	FirstName  string        `json:"first_name"`  // FirstName is the first name of the user.
	LastName   string        `json:"last_name"`   // LastName is the last name of the user.

	CreatedAtFrom time.Time `json:"created_at_from"` // CreatedAt is in the between of CreatedAtFrom and CreatedAtTo.
	CreatedAtTo   time.Time `json:"created_at_to"`   // CreatedAt is in the between of CreatedAtFrom and CreatedAtTo.
	UpdatedAtFrom time.Time `json:"updated_at_from"` // UpdatedAt is in the between of UpdatedAtFrom and UpdatedAtTo.
	UpdatedAtTo   time.Time `json:"updated_at_to"`   // UpdatedAt is in the between of UpdatedAtFrom and UpdatedAtTo.

	SearchText string           `json:"search_text"` // SearchText is the full-text search value.
	SortType   string           `json:"sort_type"`   // SortType is the sorting type (ASC,DESC).
	SortField  mo.UserSortField `json:"sort_field"`  // SortField is the sorting field of the user.

	Limit  int `json:"limit"`  // Limit provides to limitation row size.
	Offset int `json:"offset"` // Offset provides a starting row number of the limitation.
}

UserFilter is a struct that represents the filter of a user.

func NewEmptyUserFilter

func NewEmptyUserFilter() *UserFilter

NewEmptyUserFilter creates a new *UserFilter with empty values.

func NewUserFilter

func NewUserFilter(id uuid.UUID,
	compnayId uuid.UUID,
	userName string,
	email string,
	userType mo.UserType,
	userStatus mo.UserStatus,
	tags []string,
	firstName string,
	lastName string,
	createdAtFrom time.Time,
	createdAtTo time.Time,
	updatedAtFrom time.Time,
	updatedAtTo time.Time,
	searchText string,
	sortType string,
	sortField mo.UserSortField,
	limit int,
	offset int) *UserFilter

NewUserFilter creates a new *UserFilter.

func (*UserFilter) String

func (s *UserFilter) String() string

String returns a string representation of the UserFilter.

type UserPassword

type UserPassword struct {
	Id              uuid.UUID `json:"id"`      // Id is the id of the password.
	UserId          uuid.UUID `json:"user_id"` // Id is the id of the user.
	mo.UserPassword           // UserPassword is the password values of the user.
}

UserPassword is a struct that represents the entity of a user password values.

func NewEmptyUserPassword

func NewEmptyUserPassword() *UserPassword

NewEmptyUserPassword creates a new *UserPassword with empty values.

func NewUserPassword

func NewUserPassword(id uuid.UUID,
	userId uuid.UUID,
	userPassword mo.UserPassword) *UserPassword

NewUserPassword creates a new *UserPassword.

func (*UserPassword) Clear

func (s *UserPassword) Clear()

Clear clears the UserPassword.

func (*UserPassword) Clone

func (s *UserPassword) Clone() *UserPassword

Clone returns a clone of the UserPassword.

func (*UserPassword) Equals

func (s *UserPassword) Equals(other *UserPassword) bool

Equals returns true if the UserPassword is equal to the other UserPassword.

func (*UserPassword) IsEmpty

func (s *UserPassword) IsEmpty() bool

IsEmpty returns true if the UserPassword is empty.

func (*UserPassword) IsNotEmpty

func (s *UserPassword) IsNotEmpty() bool

IsNotEmpty returns true if the UserPassword is not empty.

func (*UserPassword) String

func (s *UserPassword) String() string

String returns a string representation of the UserPassword.

func (*UserPassword) Validate

func (s *UserPassword) Validate() error

Validate validates the UserPassword.

type Users

type Users struct {
	Users     []User `json:"users"`      // Users is the slice of *User.
	TotalRows int64  `json:"total_rows"` // TotalRows is the total number of rows.
}

Users contains a slice of *User and total number of users.

Jump to

Keyboard shortcuts

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