orm

package
v0.0.0-...-711136c Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Paginate

func Paginate(page int, pageSize int) func(db *gorm.DB) *gorm.DB

Types

type BaseRepo

type BaseRepo struct {
	DB    *gorm.DB
	Model interface{}
}

func (*BaseRepo) Count

func (r *BaseRepo) Count(filter interface{}) (int64, error)

func (*BaseRepo) Create

func (r *BaseRepo) Create(createModel interface{}) error

func (*BaseRepo) Delete

func (r *BaseRepo) Delete(id uint64) error

func (*BaseRepo) Find

func (r *BaseRepo) Find(filter interface{}, rstModel interface{}, customLogic func(db *gorm.DB) *gorm.DB) error

func (*BaseRepo) List

func (r *BaseRepo) List(filter interface{}, page int, pageSize int, rstModelList interface{}, customLogic func(db *gorm.DB) *gorm.DB) (int64, error)

func (*BaseRepo) Update

func (r *BaseRepo) Update(updateModel interface{}, rstModel interface{}) error

type IRepo

type IRepo interface {
	List(filter interface{}, page int, pageSize int, rstModelList interface{}) (total int64, err error)
	Find(filter interface{}, rstModel interface{}) error
	Create(rstModel interface{}) error
	Update(updateModel interface{}, rstModel interface{}) error
	Delete(id uint64) error
	Count(filter interface{}) (count int64, err error)
}

Jump to

Keyboard shortcuts

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