service

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: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthService

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

func NewAuthService

func NewAuthService(repo repository.Authorization) *AuthService

func (*AuthService) CreateUser

func (s *AuthService) CreateUser(user domain.User) (int, error)

func (*AuthService) GenerateToken

func (s *AuthService) GenerateToken(username, password string) (string, error)

func (*AuthService) ParseToken

func (s *AuthService) ParseToken(accessToken string) (int, error)

type Authorization

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

type Service

type Service struct {
	Authorization
	Wallet
	Transaction
}

func NewService

func NewService(repos *repository.Repository) *Service

type Transaction

type Transaction interface {
}

type Wallet

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

type WalletService

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

func NewWalletService

func NewWalletService(repo repository.Wallet) *WalletService

func (*WalletService) CreateWallet

func (s *WalletService) CreateWallet(userId int, wallet domain.Wallet) (int, error)

func (*WalletService) GetAllWallets

func (s *WalletService) GetAllWallets(userId int) ([]domain.Wallet, error)

func (*WalletService) GetWalletById

func (s *WalletService) 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