repository

package
v0.0.0-...-a3b1edf Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authorization

type Authorization interface {
	CreateUser(ctx context.Context, user *models.User, salt, password string) error
	GetPasswordByUserID(ctx context.Context, userID uint64) (string, string, error)
	GetUserByEmail(ctx context.Context, user *models.LoginUser) (uint64, error)
}

type DB

type DB struct {
	*sqlx.DB
}

func NewAuthRepository

func NewAuthRepository(db *sqlx.DB) *DB

func (*DB) Begintx

func (db *DB) Begintx(ctx context.Context) (*sqlx.Tx, error)

func (*DB) CreateUser

func (r *DB) CreateUser(ctx context.Context, user *models.User, salt, password string) error

func (*DB) GetPasswordByUserID

func (r *DB) GetPasswordByUserID(ctx context.Context, userID uint64) (string, string, error)

func (*DB) GetUserByEmail

func (r *DB) GetUserByEmail(ctx context.Context, user *models.LoginUser) (uint64, error)

type Repository

type Repository struct {
	Authorization
}

func NewRepository

func NewRepository(db *sqlx.DB) *Repository

Jump to

Keyboard shortcuts

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