models

package
v0.0.0-...-4115b67 Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Book

type Book struct {
	gorm.Model
	Name        string `gorm:"" json:"name"`
	Author      string `json:"author"`
	Publication string `json:"publication"`
}

func DeleteBook

func DeleteBook(ID int64) Book

func GetAllBooks

func GetAllBooks() []Book

func GetBookById

func GetBookById(Id int64) (*Book, *gorm.DB)

func (*Book) CreateBook

func (b *Book) CreateBook() *Book

type LoginRequest

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

type LoginResponse

type LoginResponse struct {
	AccessToken  string `json:"accessToken"`
	RefreshToken string `json:"refreshToken"`
}

type RefreshTokenRequest

type RefreshTokenRequest struct {
	ResfreshToken string `json:"refreshToken"`
}

type User

type User struct {
	gorm.Model
	FirstName string `gorm:"" json:"firstname"`
	LastName  string `json:"lastname"`
	Email     string `json:"email"`
	Password  string `json:"password"`
	Username  string `json:"username"`
}

func DeleteUser

func DeleteUser(ID int64) User

func GetAllUsers

func GetAllUsers() []User

func GetUserByEmail

func GetUserByEmail(email string) (*User, *gorm.DB)

func GetUserById

func GetUserById(Id int64) (*User, *gorm.DB)

func GetUserByUserName

func GetUserByUserName(username string) (*User, *gorm.DB)

func (*User) CreateUser

func (b *User) CreateUser() *User

Jump to

Keyboard shortcuts

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