gateway

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const TransactionContextKey transactionContextKey = "TransactionContextKey"

Variables

This section is empty.

Functions

func InjectTransaction

func InjectTransaction(ctx context.Context, tx Tx) context.Context

Types

type AccountRepository

type AccountRepository interface {
	Repository
	CreateAccount(ctx context.Context, account entity.Account) error
	FindAccount(ctx context.Context, accountID uuid.UUID) (*entity.Account, error)
	FindAccountByIDs(ctx context.Context, ids ...uuid.UUID) (map[uuid.UUID]*entity.Account, error)
	SaveAtomicTransactions(ctx context.Context, transactions ...entity.Transaction) error
	FindAll(ctx context.Context) ([]*entity.Account, error)
	SetSnapshotTransactions(ctx context.Context, snapshotID uuid.UUID, transactionIDs uuid.UUIDs) error
	FindAccountByEmail(ctx context.Context, email string) (*entity.Account, error)
	FindResumeAccount(ctx context.Context, email string) (*entity.ResumeAccount, error)
}

type AuthorizationService

type AuthorizationService interface {
	Authorize(ctx context.Context, account entity.Account) error
}

type Mutex

type Mutex interface {
	Lock(ctx context.Context, key string, ttl time.Duration) error
	Unlock(ctx context.Context, key string) error
}

type NotificationService

type NotificationService interface {
	Notify(ctx context.Context, account entity.Account, transaction entity.Transaction) error
}

type Repository

type Repository interface {
	NewTransaction(ctx context.Context) (Tx, error)
}

type Tx

type Tx interface {
	Commit() error
	Rollback() error
}

func GetTransactionContext

func GetTransactionContext(ctx context.Context) (Tx, bool)

Jump to

Keyboard shortcuts

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