repository

package
v0.0.0-...-3c1232d Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPostgresDB

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

Types

type AuthPostgres

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

func NewAuthPostgres

func NewAuthPostgres(db *sqlx.DB) *AuthPostgres

func (*AuthPostgres) CreateUser

func (r *AuthPostgres) CreateUser(user domain.User) (int, error)

func (*AuthPostgres) GetUser

func (r *AuthPostgres) GetUser(email, password string) (domain.User, error)

type Authorization

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

type Config

type Config struct {
	Host     string
	Port     string
	Username string
	Password string
	DBName   string
	SSLMode  string
}

type Repository

type Repository struct {
	Authorization
	Wallet
	Transaction
}

func NewRepository

func NewRepository(db *sqlx.DB) *Repository

type Transaction

type Transaction interface {
}

type Wallet

type Wallet interface {
	CreateWallet(userId int, list domain.Wallet) (int, error)
	GetAllWallets(userId int) ([]domain.Wallet, error)
	GetWalletById(userId, walletId int) (domain.Wallet, error)
}

type WalletPostgres

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

func NewWalletPostgres

func NewWalletPostgres(db *sqlx.DB) *WalletPostgres

func (*WalletPostgres) CreateWallet

func (r *WalletPostgres) CreateWallet(userId int, wallet domain.Wallet) (int, error)

func (*WalletPostgres) GetAllWallets

func (r *WalletPostgres) GetAllWallets(userId int) ([]domain.Wallet, error)

func (*WalletPostgres) GetWalletById

func (r *WalletPostgres) GetWalletById(userId, walletId int) (domain.Wallet, error)

Jump to

Keyboard shortcuts

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