scheduler

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContextJobEnableTableLogger

type ContextJobEnableTableLogger struct{}

type ContextJobID

type ContextJobID struct{}

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler scheduler handler. Be aware that each ctx has zerolog.Logger instance!

func New

func New(
	payments *payment.Service,
	blockchains *blockchain.Service,
	wallets *wallet.Service,
	processingService ProcessingService,
	transactions *transaction.Service,
	jobLogger *log.JobLogger,
) *Handler

func (*Handler) CancelExpiredPayments

func (h *Handler) CancelExpiredPayments(ctx context.Context) error

func (*Handler) CheckIncomingTransactionsProgress

func (h *Handler) CheckIncomingTransactionsProgress(ctx context.Context) error

func (*Handler) CheckInternalTransferProgress

func (h *Handler) CheckInternalTransferProgress(ctx context.Context) error

func (*Handler) CheckWithdrawalsProgress

func (h *Handler) CheckWithdrawalsProgress(ctx context.Context) error

func (*Handler) EnsureOutboundWallets added in v0.3.0

func (h *Handler) EnsureOutboundWallets(ctx context.Context) error

func (*Handler) JobLogger

func (h *Handler) JobLogger() *log.JobLogger

func (*Handler) PerformInternalWalletTransfer

func (h *Handler) PerformInternalWalletTransfer(ctx context.Context) error

PerformInternalWalletTransfer performs money transfer from INBOUND wallets to OUTBOUND ones so later customers can withdraw their assets.

func (*Handler) PerformWithdrawalsCreation

func (h *Handler) PerformWithdrawalsCreation(ctx context.Context) error

PerformWithdrawalsCreation searches for pending payments with type = withdrawal and creates transactions.

type ProcessingService

type ProcessingService interface {
	BatchCheckIncomingTransactions(ctx context.Context, transactionIDs []int64) error
	BatchCreateInternalTransfers(ctx context.Context, balances []*wallet.Balance) (*processing.TransferResult, error)
	BatchCheckInternalTransfers(ctx context.Context, transactionIDs []int64) error
	BatchCreateWithdrawals(ctx context.Context, paymentsIDs []int64) (*processing.TransferResult, error)
	BatchCheckWithdrawals(ctx context.Context, transactionIDs []int64) error
	EnsureOutboundWallet(ctx context.Context, chain money.Blockchain) (*wallet.Wallet, bool, error)
	BatchExpirePayments(ctx context.Context, paymentsIDs []int64) error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL