utils

package
v0.0.0-...-414ef0c Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Balance

type Balance struct {
	BankId   uint16
	BankName string
	Account  uint32
	Balance  int32
}

Balance transfers data to update the database accounts ledger.

type BankBalance

type BankBalance struct {
	BankId  uint16
	Name    string
	Balance int64
}

BankBalance transfers bank balance data from the cache to the database.

type BankInfo

type BankInfo struct {
	Name    string
	Account int
}

type Payment

type Payment struct {
	Sender   BankInfo
	Receiver BankInfo
	Amount   int
	Time     time.Time
}

func (*Payment) IsValidPayment

func (ct *Payment) IsValidPayment() error

type SRBalance

type SRBalance struct {
	Sender   *bankInfo
	Receiver *bankInfo
	Amount   int32
}

SRBalance captures data from the api and feeds it into the cache.

type SnapBank

type SnapBank struct {
	Balance  int64
	Accounts map[uint32]int32
}

SnapBank stores bank data relevant to a snapshot. SnapBank does not include the bank's id or name.

type Snapshot

type Snapshot struct {
	Banks     map[string]*SnapBank
	Timestamp time.Time
}

snapshot stores a synchronized snapshort of all balances. It stores integers and not pointers, since there's no need for concurrent access. Banks is nil unless a snapshot has been requested.

func (*Snapshot) Print

func (snap *Snapshot) Print()

Jump to

Keyboard shortcuts

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