memory

package
v0.0.0-...-307a5c9 Latest Latest
Warning

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

Go to latest
Published: May 21, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnknownPayment must be use while trying to read payment with unknown id
	ErrUnknownPayment = errors.New("there is no payment with given id")
	// ErrUnknownBankReference must be used when trying to read using unknown bank reference
	ErrUnknownBankReference = errors.New("unknown bank reference")
)

Functions

This section is empty.

Types

type Storage

type Storage struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Storage is an in memory implementation of a Ledger to store payments

func NewMemoryStorage

func NewMemoryStorage() *Storage

NewMemoryStorage is a factory for in memory Storage for payments

func (*Storage) Create

func (l *Storage) Create(p entity.Payment) (uuid.UUID, error)

Create adds a new payment to the Ledger

func (*Storage) Read

func (l *Storage) Read(id uuid.UUID) (entity.Payment, error)

Read returns details of a payment in the Ledger

func (*Storage) ReadUsingBankReference

func (l *Storage) ReadUsingBankReference(id uuid.UUID) (entity.Payment, error)

ReadUsingBankReference returns details of a payment in the Ledger using a bank reference

func (*Storage) Update

func (l *Storage) Update(p entity.Payment) error

Update edits information of a given payment

Jump to

Keyboard shortcuts

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