repository

package
v0.0.0-...-5122af3 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MigrateSchema

func MigrateSchema(dsn string) error

func NewDB

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

Types

type UserDB

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

func NewUserDB

func NewUserDB(db *sqlx.DB) *UserDB

func (*UserDB) CreateUser

func (u *UserDB) CreateUser(ctx context.Context, user models.User, tx *sqlx.Tx) (int, error)

func (*UserDB) ExistsEmail

func (u *UserDB) ExistsEmail(ctx context.Context, email string) (bool, error)

func (*UserDB) GetUser

func (u *UserDB) GetUser(ctx context.Context, email, password string) (models.User, error)

func (*UserDB) InTx

func (u *UserDB) InTx(
	ctx context.Context,
	opts *sql.TxOptions,
	fn func(tx *sqlx.Tx) error,
) error

Jump to

Keyboard shortcuts

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