service

package
v0.0.0-...-dd3921f Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SubscriptionHandler

type SubscriptionHandler interface {
	Subscribe(context.Context, *domain.Subscription) error
}

SubscriptionHandler defines the behavior of a subscription handler

func NewSubscriptorService

func NewSubscriptorService(opts ...SubscriptionOptions) SubscriptionHandler

NewSubscriptorService creates a new subscriptor service

type SubscriptionOptions

type SubscriptionOptions func(*subscriptorService)

SubscriptionOptions helps to configure a subscription service

func WithSubscriptor

func WithSubscriptor(svc port.Subscriptor) SubscriptionOptions

WithSubscriptor sets the subscriptor

type TransactionHandler

type TransactionHandler interface {
	Create(context.Context, *domain.Transaction) error
	List(context.Context) ([]domain.Transaction, string, error)
}

TransactionHandler defines the behavior of a transaction handler

func NewTransactionHandler

func NewTransactionHandler(opts ...TransactionOptions) TransactionHandler

NewTransactionHandler creates an instance new transaction handler

type TransactionOptions

type TransactionOptions func(*transactionService)

TransactionOptions helps to configure a transaction service

func WithLimit

func WithLimit(limit int) TransactionOptions

WithLimit sets the limit for a paginated response

func WithNext

func WithNext(next string) TransactionOptions

WithNext sets the next token for a paginated response

func WithTransactionRetriever

func WithTransactionRetriever(transactionRetriever port.TransactionRetriever) TransactionOptions

WithTransactionRetriever sets the transaction retriever

func WithTransactionWriter

func WithTransactionWriter(transactionWriter port.TransactionWriter) TransactionOptions

WithTransactionWriter sets the transaction writer

type TransactionServiceMock

type TransactionServiceMock struct {
	CreateMock func(context.Context, *domain.Transaction) error
	ListMock   func(context.Context) ([]domain.Transaction, string, error)
}

TransactionServiceMock implements the TransactionHandler interface for testing purposes

func (*TransactionServiceMock) Create

func (t *TransactionServiceMock) Create(ctx context.Context, transaction *domain.Transaction) error

Create calls the CreateMock function

func (*TransactionServiceMock) List

List calls the ListMock function

Jump to

Keyboard shortcuts

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