transaction

package
v0.0.0-...-83fe226 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2022 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TypeDebit a debit transaction type.
	TypeDebit = "debit"
	// TypeCredit a credit transaction type.
	TypeCredit = "credit"
	// TypeTransfer an internal transfer transaction type.
	TypeTransfer = "transfer"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store provides methods to add transaction records to storage.

func NewStore

func NewStore(db database.Interface) Store

NewStore returns a new Store struct.

func (Store) Create

func (s Store) Create(ctx context.Context, tx pgx.Tx, txn Transaction) error

Create a transaction record in storage.

type Transaction

type Transaction struct {
	ID          string
	Type        string
	WalletID    string
	DstWalletID string
	Amount      float64
	Timestamp   time.Time
}

Transaction is a representation of the transaction storage record.

Jump to

Keyboard shortcuts

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