Documentation ¶
Index ¶
- type AuthService
- type Authorization
- type Service
- type Transaction
- type TransactionService
- func (s *TransactionService) CreateTransaction(userId, walletId int64, transaction domain.Transaction) (int64, error)
- func (s *TransactionService) DeleteTransaction(userId, walletId, transactionId int64) error
- func (s *TransactionService) GetAllTransactions(userId, walletId int64) ([]domain.Transaction, error)
- func (s *TransactionService) GetTransactionById(userId, walletId, transactionId int64) (domain.Transaction, error)
- func (s *TransactionService) UpdateTransaction(userId, walletId, transactionId int64, input domain.UpdateTransactionInput) error
- type Wallet
- type WalletService
- func (s *WalletService) CreateWallet(userId int64, wallet domain.Wallet) (int64, error)
- func (s *WalletService) DeleteWallet(userId, walletId int64) error
- func (s *WalletService) GetAllWallets(userId int64) ([]domain.Wallet, error)
- func (s *WalletService) GetWalletById(userId, walletId int64) (domain.Wallet, error)
- func (s *WalletService) UpdateWallet(userId, walletId int64, input domain.UpdateWalletInput) error
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, repoToken repository.Tokens) *AuthService
func (*AuthService) CreateUser ¶
func (s *AuthService) CreateUser(user domain.User) (int64, error)
func (*AuthService) ParseToken ¶
func (s *AuthService) ParseToken(accessToken string) (int64, error)
func (*AuthService) RefreshToken ¶
func (s *AuthService) RefreshToken(refreshToken string) (string, string, error)
type Authorization ¶
type Service ¶
type Service struct { Authorization Wallet Transaction }
func NewService ¶
func NewService(repos *repository.Repository) *Service
type Transaction ¶
type Transaction interface { CreateTransaction(userId, walletId int64, transaction domain.Transaction) (int64, error) GetAllTransactions(userId, walletId int64) ([]domain.Transaction, error) GetTransactionById(userId, walletId, transactionId int64) (domain.Transaction, error) UpdateTransaction(userId, walletId, transactionId int64, input domain.UpdateTransactionInput) error DeleteTransaction(userId, walletId, transactionId int64) error }
type TransactionService ¶
type TransactionService struct {
// contains filtered or unexported fields
}
func NewTransactionService ¶
func NewTransactionService(repo repository.Transaction, walletRepo repository.Wallet) *TransactionService
func (*TransactionService) CreateTransaction ¶
func (s *TransactionService) CreateTransaction(userId, walletId int64, transaction domain.Transaction) (int64, error)
func (*TransactionService) DeleteTransaction ¶
func (s *TransactionService) DeleteTransaction(userId, walletId, transactionId int64) error
func (*TransactionService) GetAllTransactions ¶
func (s *TransactionService) GetAllTransactions(userId, walletId int64) ([]domain.Transaction, error)
func (*TransactionService) GetTransactionById ¶
func (s *TransactionService) GetTransactionById(userId, walletId, transactionId int64) (domain.Transaction, error)
func (*TransactionService) UpdateTransaction ¶
func (s *TransactionService) UpdateTransaction(userId, walletId, transactionId int64, input domain.UpdateTransactionInput) error
type Wallet ¶
type Wallet interface { CreateWallet(userId int64, wallet domain.Wallet) (int64, error) GetAllWallets(userId int64) ([]domain.Wallet, error) GetWalletById(userId, walletId int64) (domain.Wallet, error) UpdateWallet(userId, walletId int64, input domain.UpdateWalletInput) error DeleteWallet(userId, walletId int64) error }
type WalletService ¶
type WalletService struct {
// contains filtered or unexported fields
}
func NewWalletService ¶
func NewWalletService(repo repository.Wallet) *WalletService
func (*WalletService) CreateWallet ¶
func (*WalletService) DeleteWallet ¶
func (s *WalletService) DeleteWallet(userId, walletId int64) error
func (*WalletService) GetAllWallets ¶
func (s *WalletService) GetAllWallets(userId int64) ([]domain.Wallet, error)
func (*WalletService) GetWalletById ¶
func (s *WalletService) GetWalletById(userId, walletId int64) (domain.Wallet, error)
func (*WalletService) UpdateWallet ¶
func (s *WalletService) UpdateWallet(userId, walletId int64, input domain.UpdateWalletInput) error
Click to show internal directories.
Click to hide internal directories.