models

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateUserReq added in v1.7.4

type CreateUserReq struct {
	ID           string    `json:"-"`
	Name         string    `json:"name"`
	Surnames     string    `json:"surnames"`
	Email        string    `json:"email"`
	PasswordHash string    `json:"password"`
	Claims       []int64   `json:"claims"`
	CreatedAt    time.Time `json:"-"`
	UpdatedAt    time.Time `json:"-"`
}

CreateUserReq user request struct

func (CreateUserReq) Validate added in v1.7.4

func (req CreateUserReq) Validate() error

Validate checks that a given CreateUserReq is valid

type CreationResp

type CreationResp struct {
	InsertedID string `json:"inserted_id"`
}

CreationResp creation response struct

type LoginUserReq

type LoginUserReq struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

LoginUserReq login user request struct

func (LoginUserReq) Validate added in v1.7.4

func (req LoginUserReq) Validate() error

Validate checks that a given LoginUserReq is valid

type LoginUserResp

type LoginUserResp struct {
	User  UserResp `json:"user"`
	Token string   `json:"token"`
}

LoginUserResp login user response struct

type UpdateUserReq

type UpdateUserReq struct {
	ID          string     `json:"-"`
	Name        *string    `json:"name"`
	Surnames    *string    `json:"surnames"`
	Email       *string    `json:"email"`
	OldPassword *string    `json:"old_password"`
	NewPassword *string    `json:"new_password"`
	Claims      *[]int64   `json:"claims"`
	CreatedAt   *time.Time `json:"-"`
	UpdatedAt   *time.Time `json:"-"`
}

UpdateUserReq update user request struct

type UserResp

type UserResp struct {
	ID           string    `json:"id"`
	Name         string    `json:"name"`
	Surnames     string    `json:"surnames"`
	Email        string    `json:"email"`
	PasswordHash string    `json:"-"`
	Claims       []int64   `json:"claims"`
	CreatedAt    time.Time `json:"created_at"`
	UpdatedAt    time.Time `json:"updated_at"`
}

UserResp user response struct

Jump to

Keyboard shortcuts

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