Documentation ¶
Index ¶
- func ConsumeOrders(topic string)
- func InitPulsar() error
- func ProcessPayment(order *models.Order) *models.Transaction
- func PublishLogs(logMessage *models.PaymentLogMessage) error
- func PublishTransaction(transaction *models.Transaction) error
- func SaveTransaction(transaction *models.Transaction) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConsumeOrders ¶
func ConsumeOrders(topic string)
ConsumeOrders consumes order messages from the orders Pulsar topic and processes them.
func InitPulsar ¶
func InitPulsar() error
InitPulsar initializes a Pulsar client for the payment service.
func ProcessPayment ¶
func ProcessPayment(order *models.Order) *models.Transaction
ProcessPayment simulates payment processing for an order.
func PublishLogs ¶
func PublishLogs(logMessage *models.PaymentLogMessage) error
PublishLogs publishes the transaction logs to the payment-logs-topic.
func PublishTransaction ¶
func PublishTransaction(transaction *models.Transaction) error
PublishTransaction publishes the transaction result to the specified Pulsar topic.
func SaveTransaction ¶
func SaveTransaction(transaction *models.Transaction) error
SaveTransaction stores the transaction details in the database.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.