service

package
v0.0.0-...-9b7003c Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WalletCacheStore

type WalletCacheStore interface {
	SaveBalance(ctx context.Context, balance *domain.WalletBalance) error
	GetBalance(ctx context.Context, walletID int) (*domain.WalletBalance, error)
}

type WalletService

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

func NewWalletService

func NewWalletService(txFactory WalletStoreTxFactory, cache WalletCacheStore) *WalletService

func (*WalletService) CreditMoney

func (s *WalletService) CreditMoney(ctx context.Context, entry domain.CreditEntry) error

func (*WalletService) DebitMoney

func (s *WalletService) DebitMoney(ctx context.Context, entry domain.DebitEntry) error

func (*WalletService) GetBalance

func (s *WalletService) GetBalance(ctx context.Context, walletID int) (*domain.WalletBalance, error)

type WalletStoreTx

type WalletStoreTx interface {
	domain.WalletStore
	Commit(ctx context.Context) error
	Rollback(ctx context.Context) error
}

type WalletStoreTxFactory

type WalletStoreTxFactory interface {
	NewTx(ctx context.Context) (WalletStoreTx, error)
}

Jump to

Keyboard shortcuts

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