repository

package
v0.0.0-...-4f9ff06 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2022 License: BSD-2-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoMigrate

func AutoMigrate(db *gorm.DB) error

AutoMigrate execute gorm auto migrations on database

func DBMigrate

func DBMigrate(dbInstance *gorm.DB, dbName string) error

DBMigrate execute all migrations internal.repository.migrations with migrate

Types

type UserGORMRepo

type UserGORMRepo struct {
	DB *gorm.DB
}

UserGORMRepo ...

func NewGORMUserRepository

func NewGORMUserRepository(dbInstance *gorm.DB) *UserGORMRepo

NewGORMUserRepository ...

func (*UserGORMRepo) Create

func (u *UserGORMRepo) Create(ctx context.Context, user *entity.User) error

Create a user

func (*UserGORMRepo) Delete

func (u *UserGORMRepo) Delete(ctx context.Context, user *entity.User) error

Delete a user

func (*UserGORMRepo) Get

func (u *UserGORMRepo) Get(ctx context.Context, id int64) (user *entity.User, err error)

Get return a user

func (*UserGORMRepo) GetByEmail

func (u *UserGORMRepo) GetByEmail(ctx context.Context, email string) (user *entity.User, err error)

GetByEmail return a user filtered by email

func (*UserGORMRepo) Update

func (u *UserGORMRepo) Update(ctx context.Context, user *entity.User) error

Update a user

Jump to

Keyboard shortcuts

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