models

package
v0.0.0-...-66263c1 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminUpdateUser

type AdminUpdateUser struct {
	FirstName string `json:"first_name"`
	LastName  string `json:"last_name"`
	IsAdmin   string `json:"is_admin"`
	IsActive  string `json:"is_active"`
}

for admin user

type LoginRequest

type LoginRequest struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type LoginResponse

type LoginResponse struct {
	ID           int    `json:"id"`
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
}

type RegisterUser

type RegisterUser struct {
	ID        int       `json:"id"`
	FirstName string    `json:"first_name"`
	LastName  string    `json:"last_name"`
	Username  string    `json:"username"`
	Email     string    `json:"email"`
	Password  string    `json:"password"`
	IsAdmin   string    `json:"is_admin"`
	IsActive  string    `json:"is_active"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
	LastLogin time.Time `json:"last_login"`
}

for regestering new users

func RegisterNewUser

func RegisterNewUser(firstName, lastName, username, email, password string) (*RegisterUser, error)

type TokenMetaData

type TokenMetaData struct {
	ID int `json:"id"`
}

type UpdateUser

type UpdateUser struct {
	FistName string `json:"first_name"`
	LastName string `json:"last_name"`
}

type User

type User struct {
	ID        int       `json:"id"`
	FirstName string    `json:"first_name"`
	LastName  string    `json:"last_name"`
	Username  string    `json:"username"`
	Email     string    `json:"email"`
	Password  string    `json:"-"`
	IsAdmin   string    `json:"is_admin"`
	IsActive  string    `json:"is_active"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
	LastLogin time.Time `json:"last_login"`
}

func NewUser

func NewUser(firstName, lastName, username, email, password string) (*User, error)

type UserNhash

type UserNhash struct {
	ID       int    `json:"id"`
	Password string `json:"password"`
}

Jump to

Keyboard shortcuts

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