Documentation
¶
Index ¶
- type AuthService
- type Authorization
- type JWT
- type JWTService
- type Service
- type Transaction
- type TransactionService
- func (t *TransactionService) CountTransaction(userID string) (int64, error)
- func (t *TransactionService) GetTransactions(userID string, query *dto.TransactionRequestQuery) ([]*models.Transaction, error)
- func (t *TransactionService) TopUp(input *dto.TopUpRequestBody) (*models.Transaction, error)
- func (t *TransactionService) Transfer(input *dto.TransferRequestBody) (*models.Transaction, error)
- type User
- type UserService
- type Wallet
- type WalletService
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.Repository) *AuthService
func (*AuthService) Attempt ¶
func (a *AuthService) Attempt(input *dto.LoginRequestBody) (*models.User, error)
func (*AuthService) ForgotPass ¶
func (a *AuthService) ForgotPass(input *dto.ForgotPasswordRequestBody) (*models.PasswordReset, error)
func (*AuthService) ResetPass ¶
func (a *AuthService) ResetPass(input *dto.ResetPasswordRequestBody) (*models.PasswordReset, error)
type Authorization ¶
type Authorization interface { Attempt(input *dto.LoginRequestBody) (*models.User, error) ForgotPass(input *dto.ForgotPasswordRequestBody) (*models.PasswordReset, error) ResetPass(input *dto.ResetPasswordRequestBody) (*models.PasswordReset, error) }
type JWTService ¶
type JWTService struct {
// contains filtered or unexported fields
}
func NewJWTService ¶
func NewJWTService(repo repository.Repository) *JWTService
func (*JWTService) GenerateToken ¶
func (j *JWTService) GenerateToken(userID string) (string, error)
func (*JWTService) SendVerificationToken ¶
func (j *JWTService) SendVerificationToken(user *models.User) error
func (*JWTService) ValidateToken ¶
func (j *JWTService) ValidateToken(token string) (*jwt.Token, error)
func (*JWTService) VerifyUser ¶
type Service ¶
type Service struct { Authorization JWT User Wallet Transaction }
func NewService ¶
func NewService(repo *repository.Repository) *Service
type Transaction ¶
type Transaction interface { GetTransactions(userID string, query *dto.TransactionRequestQuery) ([]*models.Transaction, error) TopUp(input *dto.TopUpRequestBody) (*models.Transaction, error) Transfer(input *dto.TransferRequestBody) (*models.Transaction, error) CountTransaction(userID string) (int64, error) }
type TransactionService ¶
type TransactionService struct {
// contains filtered or unexported fields
}
func NewTransactionService ¶
func NewTransactionService(repo repository.Repository) *TransactionService
func (*TransactionService) CountTransaction ¶
func (t *TransactionService) CountTransaction(userID string) (int64, error)
func (*TransactionService) GetTransactions ¶
func (t *TransactionService) GetTransactions(userID string, query *dto.TransactionRequestQuery) ([]*models.Transaction, error)
func (*TransactionService) TopUp ¶
func (t *TransactionService) TopUp(input *dto.TopUpRequestBody) (*models.Transaction, error)
func (*TransactionService) Transfer ¶
func (t *TransactionService) Transfer(input *dto.TransferRequestBody) (*models.Transaction, error)
type User ¶
type User interface { GetUser(input *dto.UserRequestParams) (*models.User, error) CreateUser(input *dto.RegisterRequestBody) (*models.User, error) }
type UserService ¶
type UserService struct {
// contains filtered or unexported fields
}
func NewUserService ¶
func NewUserService(repo repository.Repository) *UserService
func (*UserService) CreateUser ¶
func (u *UserService) CreateUser(input *dto.RegisterRequestBody) (*models.User, error)
func (*UserService) GetUser ¶
func (u *UserService) GetUser(input *dto.UserRequestParams) (*models.User, error)
type WalletService ¶
type WalletService struct {
// contains filtered or unexported fields
}
func NewWalletService ¶
func NewWalletService(repo repository.Repository) *WalletService
func (*WalletService) CreateWallet ¶
func (w *WalletService) CreateWallet(input *dto.WalletRequestBody) (*models.Wallet, error)
func (*WalletService) GetWalletByNumber ¶
func (w *WalletService) GetWalletByNumber(number string) (*models.Wallet, error)
func (*WalletService) GetWalletByUserId ¶
func (w *WalletService) GetWalletByUserId(input *dto.WalletRequestBody) (*models.Wallet, error)
Click to show internal directories.
Click to hide internal directories.