model

package
v0.0.0-...-5e1236a Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type User

type User struct {
	ID        uuid.UUID `json:"user_id"`
	FirstName string    `json:"first_name" validate:"max=128"`
	LastName  string    `json:"last_name" validate:"max=128"`
	Password  string    `json:"password"`
	Email     string    `json:"email"`
	Address   string    `json:"address" validate:"max=128"`
	Phone     string    `json:"phone"`
	Role      UserRoles `json:"role" validate:"oneof=0 1 2 3"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

Represents how the user structure is stored in the database

func (*User) ToProto

func (user *User) ToProto() *pbUser.UserResponse

func (*User) Validate

func (user *User) Validate() error

type UserRoles

type UserRoles int
const (
	Guest UserRoles = iota
	RegisteredUser
	Admin
	SuperAdmin
)

Jump to

Keyboard shortcuts

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