bank

package
v0.0.0-...-8f95268 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrAccountNotExist means query account not exist
	ErrAccountNotExist = fmt.Errorf("Account not exist")

	// ErrBalanceNotEnough means account does not have enough money
	ErrBalanceNotEnough = fmt.Errorf("Balance not enough")

	// ErrSelfTransfer means trade want to transfer money to the same account
	ErrSelfTransfer = fmt.Errorf("Self transfer")

	// ErrUpdateBalance
	ErrUpdateBalance = fmt.Errorf("fail to update balance")

	// ErrInvalidDealing
	ErrInvalidDealing = fmt.Errorf("Invalid dealing")
)

Functions

This section is empty.

Types

type Bank

type Bank interface {
	// Trade executes dealings
	Trade(ctx context.Context, dealing *mBank.Dealing) (string, error)

	// GetAccount get account Information
	GetAccount(ctx context.Context, accountID string) (*mBank.Account, error)
}

func NewBank

func NewBank(db *sqlx.DB) Bank

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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