Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInternalServerError will throw if any the Internal Server Error happen ErrInternalServerError = errors.New("internal Server Error") // ErrNotFound will throw if the requested item is not exists ErrNotFound = errors.New("your requested Item is not found") // ErrConflict will throw if the current action already exists ErrConflict = errors.New("your Item already exist") // ErrBadParamInput will throw if the given request-body or params is not valid ErrBadParamInput = errors.New("given Param is not valid") )
Functions ¶
This section is empty.
Types ¶
type Exchange ¶
func NewExchange ¶
type ExchangeRepository ¶
type ExchangeRepository interface {
GetByCurrency(ctx context.Context, currency string) (Exchange, error)
}
Exchange repository
type Transaction ¶
type Transaction struct { //TODO ID ID int64 `json:"id"` WalletId int64 `json:"wallet_id" binding:"required"` TransactionType TransactionType `json:"transactionType" binding:"required,oneof=deposit withdraw"` Amount float64 `json:"amount" binding:"required"` Currency string `json:"currency" binding:"required,iso4217"` CreatedAt time.Time `json:"created_at"` }
func NewTransaction ¶
func NewTransaction(walletId int64, transactionType TransactionType, currency string, amount float64) Transaction
type TransactionRepository ¶
type TransactionRepository interface { Store(ctx context.Context, t Transaction) error GetHistory(ctx context.Context) ([]Transaction, error) }
Transaction Repository
type TransactionType ¶
type TransactionType string
const ( Deposit TransactionType = "deposit" Withdrawal TransactionType = "withdrawal" )
type TransactionUseCase ¶
type TransactionUseCase interface { History(ctx context.Context) ([]Transaction, error) Post(ctx context.Context, t Transaction) error }
type User ¶
type UserRepository ¶
type UserRepository interface { Store(ctx context.Context, u User) error Update(ctx context.Context, u User) error }
User Repository
type UserUseCase ¶
User Usecase
type Wallet ¶
Click to show internal directories.
Click to hide internal directories.