Documentation ¶
Index ¶
- Variables
- func BackendRun()
- func CompleteLoadRequest(ctx context.Context, w http.ResponseWriter, r *http.Request)
- func CreateLoadRequest(ctx context.Context, w http.ResponseWriter, r *http.Request)
- func CreateLoadRequestService(tx *pgx.Tx, req LoadRequestRequest) error
- func CreateTransferRequest(ctx context.Context, w http.ResponseWriter, r *http.Request)
- func GetCurrentDeposit(ctx context.Context, w http.ResponseWriter, r *http.Request)
- func GetLoadRequest(ctx context.Context, w http.ResponseWriter, r *http.Request)
- func GetTransferRequest(ctx context.Context, w http.ResponseWriter, r *http.Request)
- func HelloJob(j *que.Job) error
- func Load(rows *pgx.Rows, value interface{}) (int, error)
- func NewBackendDB(dbURI string) (*pgx.ConnPool, error)
- func NewHTTPClient() *http.Client
- func NewProxyDB(dbURI string) (*pgx.ConnPool, error)
- func NewQueClient(dbURI string) (*que.Client, error)
- func NotFound(ctx context.Context, w http.ResponseWriter, r *http.Request)
- func ProxyRun()
- func ToInsertSQL(stmt *dbr.InsertStmt) (string, error)
- func ToSelectSQL(stmt *dbr.SelectStmt) (string, error)
- func ToUpdateSQL(stmt *dbr.UpdateStmt) (string, error)
- func UpdateCurrentDeposit(ctx context.Context, w http.ResponseWriter, r *http.Request)
- func UpdateDepositJob(j *que.Job) error
- func UpdateLoadRequestService(tx *pgx.Tx, req LoadRequestRequest) error
- type Account
- type GetLoadRequestRequest
- type LoadRequestModel
- type LoadRequestRequest
- type LoadRequestResponse
- type MessageResponse
- type StatusMessage
- type TransferRequestRequest
Constants ¶
This section is empty.
Variables ¶
var (
ErrInvalidPointer = errors.New("attempt to load into an invalid pointer")
)
package errors
Functions ¶
func CompleteLoadRequest ¶
CompleteLoadRequest update completed status
func CreateLoadRequest ¶
CreateLoadRequest add load request
func CreateLoadRequestService ¶
func CreateLoadRequestService(tx *pgx.Tx, req LoadRequestRequest) error
CreateLoadRequestService creates load request
func CreateTransferRequest ¶
CreateTransferRequest add transfer request
func GetCurrentDeposit ¶
GetCurrentDeposit get current deposit
func GetLoadRequest ¶
GetLoadRequest get load requests
func GetTransferRequest ¶
GetTransferRequest get transfer request
func NewQueClient ¶
NewQueClient create que client
func ToInsertSQL ¶
func ToInsertSQL(stmt *dbr.InsertStmt) (string, error)
ToInsertSQL create insert sql string
func ToSelectSQL ¶
func ToSelectSQL(stmt *dbr.SelectStmt) (string, error)
ToSelectSQL create select sql string
func ToUpdateSQL ¶
func ToUpdateSQL(stmt *dbr.UpdateStmt) (string, error)
ToUpdateSQL create update sql string
func UpdateCurrentDeposit ¶
UpdateCurrentDeposit create/update current deposit
func UpdateDepositJob ¶
func UpdateDepositJob(j *que.Job) error
UpdateDepositJob updates deposit in backend service
func UpdateLoadRequestService ¶
func UpdateLoadRequestService(tx *pgx.Tx, req LoadRequestRequest) error
UpdateLoadRequestService updates load request
Types ¶
type GetLoadRequestRequest ¶
type GetLoadRequestRequest struct {
AccountID int `json:"accountId"`
}
GetLoadRequestRequest load request
type LoadRequestModel ¶
type LoadRequestModel struct { ID int32 `json:"id"` AccountID int32 `json:"accountID"` Amount int32 `json:"amount"` Completed bool `json:"completed"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` }
LoadRequestModel load request struct
func GetLoadRequestService ¶
func GetLoadRequestService(tx *pgx.Tx, req GetLoadRequestRequest) ([]LoadRequestModel, error)
GetLoadRequestService get load request
type LoadRequestRequest ¶
type LoadRequestRequest struct { RequestID int `json:"id"` AccountID int `json:"accountId"` Amount int `json:"amount"` }
LoadRequestRequest load request struct
type LoadRequestResponse ¶
type LoadRequestResponse struct {
Data []LoadRequestModel `json:"data"`
}
LoadRequestResponse struct
type MessageResponse ¶
type MessageResponse struct {
Data StatusMessage `json:"data"`
}
MessageResponse struct
type StatusMessage ¶
type StatusMessage struct { Message string `json:"message"` RequestID int `json:"requestId,omitempty"` }
StatusMessage struct
type TransferRequestRequest ¶
type TransferRequestRequest struct { FromAccountID int `json:"fromAccountId"` ToAccountID int `json:"toAccountId"` Amount int `json:"amount"` }
TransferRequestRequest transfer request struct