repository

package
v0.0.0-...-5a22857 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DB

func DB() *gorm.DB

*

  • Database Connection
  • @return *gorm.DB
  • @return error

Types

type ProductRepository

type ProductRepository interface {
	Getproduct(int) (model.Product, error)              //GetProduct --> returns product by id
	GetAllproduct() ([]model.Product, error)            //GetAllProduct --> returns all products
	AddProduct(model.Product) (model.Product, error)    //AddProduct --> adds new product
	UpdateProduct(model.Product) (model.Product, error) //UpdateProduct --> updates product
	DeleteProduct(model.Product) (model.Product, error) //DeleteProduct --> deletes product
}

ProductRepository --> Interface to ProductRepository

func NewProductRepository

func NewProductRepository() ProductRepository

NewProductRepository --> returns new product repository

type UserRepository

type UserRepository interface {
	AddUser(model.User) (model.User, error)       //AddUser
	GetUser(int) (model.User, error)              //GetUser
	GetByEmail(string) (model.User, error)        //GetByEmail
	GetAllUser() ([]model.User, error)            //GetAllUser
	UpdateUser(model.User) (model.User, error)    //UpdateUser
	DeleteUser(model.User) (model.User, error)    //DeleteUser
	GetProductOrdered(int) ([]model.Order, error) //GetProductOrdered
}

*

  • User Repository Interface *
  • @return UserRepository

func NewUserRepository

func NewUserRepository() UserRepository

NewUserRepository --> returns new user repository

Jump to

Keyboard shortcuts

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