subscriber

package
v0.0.0-...-553ec8c Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNilConfig = errors.New("cannot override nil config")

Functions

This section is empty.

Types

type Config

type Config struct {
	FailedTransactionTopic    string
	SucceededTransactionTopic string
}

Config represents the subscriber configuration structure.

type TransactionSubscriber

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

TransactionSubscriber represents a service that subscribes to transaction-related messages and handles them based on their type (succeeded or failed).

func NewTransactionSubscriber

func NewTransactionSubscriber(
	cfg *Config,
	log logger.Logger,
	sub message.Subscriber,
	router *message.Router,
	transactionRepo repository.TransactionRepo,
) (*TransactionSubscriber, error)

NewTransactionSubscriber creates a new TransactionSubscriber instance with the provided dependencies.

func (*TransactionSubscriber) RegisterFailedTransactionHandler

func (s *TransactionSubscriber) RegisterFailedTransactionHandler()

RegisterFailedTransactionHandler registers a handler for failed transaction messages.

func (*TransactionSubscriber) RegisterSucceededTransactionHandler

func (s *TransactionSubscriber) RegisterSucceededTransactionHandler()

RegisterSucceededTransactionHandler registers a handler for succeeded transaction messages.

func (*TransactionSubscriber) Run

Run starts the transaction subscriber's router.

type TransactionSubscriberError

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

TransactionSubscriberError represents an error type specific to the creation of transaction subscribers.

func NewTransactionSubscriberError

func NewTransactionSubscriberError(msg string, err error) *TransactionSubscriberError

NewTransactionSubscriberError creates a new TransactionSubscriberError instance.

func (TransactionSubscriberError) Error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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