models

package
v0.0.0-...-a455c07 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2022 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 IUserRepository

type IUserRepository interface {
	GetUserByUsernameAndPassword(username string, password string) (*User, error)
	GetAllUsers() ([]User, error)
	GetUserByID(userID string) (User, error)
}

type User

type User struct {
	gorm.Model
	Name     string `json:"name,omitempty"`
	Username string `json:"username,omitempty"`
	Email    string `json:"email,omitempty" gorm:"unique"`
	Password string `json:"password,omitempty"`
}

func (User) TableName

func (User) TableName() string

type UserRepository

type UserRepository struct {
	DB *gorm.DB
}

func (*UserRepository) GetAllUsers

func (c *UserRepository) GetAllUsers() ([]User, error)

func (*UserRepository) GetUserByID

func (c *UserRepository) GetUserByID(userID string) (*User, error)

func (*UserRepository) GetUserByUsernameAndPassword

func (c *UserRepository) GetUserByUsernameAndPassword(username string, password string) (User, error)

Jump to

Keyboard shortcuts

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