repository

package
v0.0.0-...-c98c4ae Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthDB

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

func NewAuthDB

func NewAuthDB(db *sqlx.DB) *AuthDB

func (*AuthDB) CreateUser

func (s *AuthDB) CreateUser(usr model.User) error

func (*AuthDB) GetUser

func (s *AuthDB) GetUser(username, password string) (*model.User, error)

type Authorization

type Authorization interface {
	CreateUser(user model.User) error
	GetUser(username, password string) (*model.User, error)
}

type Repository

type Repository struct {
	Authorization
	Wallet
}

func NewRepository

func NewRepository(db *sqlx.DB) *Repository

type Wallet

type Wallet interface {
	GetBalance(userId int) (*model.Currency, error)
	Deposit(dep *model.Operation) error
	Withdraw(with *model.Operation) error
}

type WalletDB

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

func NewWalletDB

func NewWalletDB(db *sqlx.DB) *WalletDB

func (*WalletDB) Deposit

func (w *WalletDB) Deposit(dep *model.Operation) error

func (*WalletDB) GetBalance

func (w *WalletDB) GetBalance(userId int) (*model.Currency, error)

func (*WalletDB) Withdraw

func (w *WalletDB) Withdraw(with *model.Operation) error

Jump to

Keyboard shortcuts

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