Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ashishjuyal/banking
/ functions
Functions
60 in github.com/ashishjuyal/banking
⨍
Functions
60
◇
Types & classes
22
↓ 12 callers
Function
writeResponse
(w http.ResponseWriter, code int, data interface{})
app/customerHandlers.go:39
↓ 4 callers
Method
NewAccount
(request dto.NewAccountRequest)
service/accountService.go:13
↓ 4 callers
Method
Validate
()
dto/transaction.go:24
↓ 3 callers
Method
GetAllCustomer
(string)
service/customerService.go:11
↓ 3 callers
Function
NewAccountService
(repo domain.AccountRepository)
service/accountService.go:64
↓ 3 callers
Method
Save
(account Account)
domain/account.go:25
↓ 3 callers
Method
ToDto
()
domain/customer.go:25
↓ 2 callers
Method
IsTransactionTypeWithdrawal
()
dto/transaction.go:16
↓ 2 callers
Function
setup
(t *testing.T)
service/accountService_test.go:31
↓ 2 callers
Function
setup
(t *testing.T)
app/customerHandlers_test.go:18
↓ 1 callers
Method
ById
(string)
domain/customer.go:38
↓ 1 callers
Method
CanWithdraw
(amount float64)
domain/account.go:30
↓ 1 callers
Method
FindAll
(status string)
domain/customer.go:37
↓ 1 callers
Method
FindBy
(accountId string)
domain/account.go:27
↓ 1 callers
Method
FindBy
(accountId string)
domain/AccountRepositoryDb.go:86
↓ 1 callers
Method
GetCustomer
(string)
service/customerService.go:12
↓ 1 callers
Method
IsAuthorized
(token string, routeName string, vars map[string]string)
domain/authRepository.go:12
↓ 1 callers
Method
IsTransactionTypeDeposit
()
dto/transaction.go:20
↓ 1 callers
Method
IsWithdrawal
()
domain/transaction.go:15
↓ 1 callers
Method
MakeTransaction
(request dto.TransactionRequest)
service/accountService.go:14
↓ 1 callers
Function
NewAccount
(customerId, accountType string, amount float64)
domain/account.go:37
↓ 1 callers
Function
NewAccountRepositoryDb
(dbClient *sqlx.DB)
domain/AccountRepositoryDb.go:97
↓ 1 callers
Function
NewAuthRepository
()
domain/authRepository.go:57
↓ 1 callers
Function
NewCustomerRepositoryDb
(dbClient *sqlx.DB)
domain/CustomerRepositoryDb.go:51
↓ 1 callers
Function
NewCustomerService
(repository domain.CustomerRepository)
service/customerService.go:47
↓ 1 callers
Method
SaveTransaction
(transaction Transaction)
domain/account.go:26
↓ 1 callers
Method
SaveTransaction
** * transaction = make an entry in the transaction table + update the balance in the accounts table */
domain/AccountRepositoryDb.go:35
↓ 1 callers
Function
Start
()
app/app.go:33
↓ 1 callers
Method
ToNewAccountResponseDto
()
domain/account.go:19
↓ 1 callers
Method
authorizationHandler
()
app/authMiddleware.go:15
↓ 1 callers
Function
buildVerifyURL
* This will generate a url for token verification in the below format /auth/verify?token={token string} &routeName={current route n
domain/authRepository.go:45
↓ 1 callers
Function
getDbClient
()
app/app.go:75
↓ 1 callers
Function
getTokenFromHeader
(header string)
app/authMiddleware.go:40
↓ 1 callers
Function
sanityCheck
()
app/app.go:16
↓ 1 callers
Method
statusAsText
()
domain/customer.go:17
Method
ById
(id string)
domain/CustomerRepositoryDb.go:35
Method
FindAll
()
domain/customerRepositoryStub.go:7
Method
FindAll
(status string)
domain/CustomerRepositoryDb.go:15
Method
GetAllCustomer
(status string)
service/customerService.go:19
Method
GetCustomer
(id string)
service/customerService.go:38
Method
IsAuthorized
(token string, routeName string, vars map[string]string)
domain/authRepository.go:18
Method
MakeTransaction
(req dto.TransactionRequest)
service/accountService.go:33
Method
MakeTransaction
customers/2000/accounts/90720
app/accountHandler.go:34
Method
NewAccount
(req dto.NewAccountRequest)
service/accountService.go:21
Method
NewAccount
(w http.ResponseWriter, r *http.Request)
app/accountHandler.go:15
Function
NewCustomerRepositoryStub
()
domain/customerRepositoryStub.go:11
Method
Save
(a Account)
domain/AccountRepositoryDb.go:14
Function
Test_should_return_a_validation_error_response_when_the_request_is_not_validated
(t *testing.T)
service/accountService_test.go:12
Function
Test_should_return_an_error_from_the_server_side_if_the_new_account_cannot_be_created
(t *testing.T)
service/accountService_test.go:41
Function
Test_should_return_customers_with_status_code_200
(t *testing.T)
app/customerHandlers_test.go:30
Function
Test_should_return_error_when_amount_is_less_than_zero
(t *testing.T)
dto/transaction_test.go:26
Function
Test_should_return_error_when_transaction_type_is_not_deposit_or_withdrawl
(t *testing.T)
dto/transaction_test.go:8
Function
Test_should_return_new_account_response_when_a_new_account_is_saved_successfully
(t *testing.T)
service/accountService_test.go:69
Function
Test_should_return_status_code_500_with_error_message
(t *testing.T)
app/customerHandlers_test.go:52
Function
Test_should_rollback_transaction_in_case_of_failure
(t *testing.T)
domain/AccountRepositoryDb_test.go:10
Method
ToDto
()
domain/transaction.go:22
Method
Validate
()
dto/newAccountRequest.go:14
Method
getAllCustomers
(w http.ResponseWriter, r *http.Request)
app/customerHandlers.go:14
Method
getCustomer
(w http.ResponseWriter, r *http.Request)
app/customerHandlers.go:27
Function
main
()
main.go:7