repository

package
v0.0.0-...-991bd03 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsDuplicateErr

func IsDuplicateErr(err error) bool

func IsRecordNotfound

func IsRecordNotfound(err error) bool

Types

type BaseRepository

type BaseRepository struct{}

func (*BaseRepository) Create

func (r *BaseRepository) Create(db *gorm.DB, params interface{}) (err error)

func (*BaseRepository) Delete

func (r *BaseRepository) Delete(db *gorm.DB, params interface{}) (err error)

func (*BaseRepository) FindOne

func (r *BaseRepository) FindOne(db *gorm.DB, result interface{}) (err error)

func (*BaseRepository) Update

func (r *BaseRepository) Update(db *gorm.DB, params interface{}) (err error)

type IFaceRepository

type IFaceRepository interface {
	// user
	CreateUser(ctx context.Context, data *model.User, db *gorm.DB) error
	FindOneUser(ctx context.Context, query ...interface{}) (*model.User, error)
}

func New

func New(db *gorm.DB, mongo *mongo.Database) IFaceRepository

type Repository

type Repository struct {
	BaseRepository
	// contains filtered or unexported fields
}

func (*Repository) CreateUser

func (r *Repository) CreateUser(ctx context.Context, data *model.User, db *gorm.DB) error

CreateUser implements IFaceRepository.

func (*Repository) FindOneUser

func (r *Repository) FindOneUser(ctx context.Context, query ...interface{}) (*model.User, error)

FindOneUser implements IFaceRepository.

Jump to

Keyboard shortcuts

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