models

package
v0.0.0-...-f3df126 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LoginInput

type LoginInput struct {
	Email    string `json:"email" validate:"required,email"`
	Password string `json:"password" validate:"required,min=7"`
}

type UpdatePasswordInput

type UpdatePasswordInput struct {
	Password    string `json:"password" validate:"required,min=7"`
	NewPassword string `json:"new_password" validate:"required,min=7"`
}

type UpdateUserInput

type UpdateUserInput struct {
	Firstname string `json:"firstname" validate:"omitempty,min=3,max=30"`
	Lastname  string `json:"lastname" validate:"omitempty,min=3,max=30"`
	Username  string `json:"username" validate:"omitempty,min=3,max=30"`
	Email     string `json:"email" validate:"omitempty,email"`
}

type User

type User struct {
	ID        uuid.UUID  `json:"id"`
	Firstname string     `json:"firstname" validate:"required,min=3,max=30"`
	Lastname  string     `json:"lastname" validate:"required,min=3,max=30"`
	Username  string     `json:"username" validate:"omitempty,min=3,max=30"`
	Email     string     `json:"email" validate:"required,email"`
	Password  string     `json:"password" validate:"required,min=7"`
	CreatedAt time.Time  `json:"created_at,omitempty" db:"created_at"`
	UpdatedAt time.Time  `json:"updated_at,omitempty" db:"updated_at"`
	DeletedAt *time.Time `json:"deleted_at,omitempty" db:"deleted_at"`
}

func (*User) FromJSON

func (u *User) FromJSON(r io.Reader) error

func (*User) ToJSON

func (u *User) ToJSON(w io.Writer) error

func (*User) Validate

func (u *User) Validate() error

type UserResponse

type UserResponse struct {
	ID        uuid.UUID `json:"id"`
	Firstname string    `json:"firstname" validate:"required,min=3,max=30"`
	Lastname  string    `json:"lastname" validate:"required,min=3,max=30"`
	Username  string    `json:"username" validate:"omitempty,min=3,max=30"`
	Email     string    `json:"email" validate:"required,email"`
	CreatedAt time.Time `json:"created_at,omitempty"`
	UpdatedAt time.Time `json:"updated_at,omitempty"`
}

Jump to

Keyboard shortcuts

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