database

package
v0.0.0-...-3751b6e Latest Latest
Warning

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

Go to latest
Published: Oct 25, 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 Product

type Product struct {
	DB *gorm.DB
}

func NewProduct

func NewProduct(db *gorm.DB) *Product

func (*Product) Create

func (p *Product) Create(product *entity.Product) error

func (*Product) Delete

func (p *Product) Delete(id string) error

func (*Product) FindAll

func (p *Product) FindAll(page, limit int, sort string) ([]*entity.Product, error)

func (*Product) FindById

func (p *Product) FindById(id string) (*entity.Product, error)

func (*Product) Update

func (p *Product) Update(product *entity.Product) error

type ProductInterface

type ProductInterface interface {
	Create(product *entity.Product) error
	FindAll(page, limit int, sort string) ([]*entity.Product, error)
	FindById(id string) (*entity.Product, error)
	Update(product *entity.Product) error
	Delete(id string) error
}

type User

type User struct {
	DB *gorm.DB
}

func NewUser

func NewUser(db *gorm.DB) *User

func (*User) Create

func (u *User) Create(user *entity.User) error

func (*User) FindByEmail

func (u *User) FindByEmail(email string) (*entity.User, error)

type UserInterface

type UserInterface interface {
	Create(user *entity.User) error
	FindByEmail(email string) (*entity.User, error)
}

Jump to

Keyboard shortcuts

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