repository

package
v0.0.0-...-967a65d Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MigrateSchema

func MigrateSchema(cfg *config.DB) error

func NewPostgresDB

func NewPostgresDB(cfg *config.DB) (*sqlx.DB, error)

Types

type Repository

type Repository struct {
	*UserPostgres
}

func NewRepository

func NewRepository(db *sqlx.DB) *Repository

type UserPostgres

type UserPostgres struct {
	// contains filtered or unexported fields
}

func NewUserPostgres

func NewUserPostgres(db *sqlx.DB) *UserPostgres

func (*UserPostgres) Create

func (u *UserPostgres) Create(ctx context.Context, user *models.User) (int, error)

func (*UserPostgres) Delete

func (u *UserPostgres) Delete(ctx context.Context, id int) (bool, error)

func (*UserPostgres) GetAll

func (u *UserPostgres) GetAll(ctx context.Context) ([]*models.User, error)

func (*UserPostgres) GetByEmail

func (u *UserPostgres) GetByEmail(ctx context.Context, email string) (*models.User, error)

Jump to

Keyboard shortcuts

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