producer

package
v0.0.0-...-3414fa2 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMessageBatchEvent

func NewMessageBatchEvent(
	userId int64,
	batchId string,
	total int32,
	completed int32,
	failed int32,
	status string,
	eventType types.MessageEventType,
) *types.MessageBatchEvent

Batch message events

func NewMessageEventSentEvent

func NewMessageEventSentEvent(
	messageId string,
	userId int64,
	channel string,
	content string,
	recipient string,
	status string,
	variables map[string]string,
) *types.MessageEventSentEvent

Event message events

func NewMessagePaymentFailedEvent

func NewMessagePaymentFailedEvent(
	userId int64,
	orderNo string,
	paymentNo string,
	amount float64,
	reason string,
	channel string,
	templateId int64,
) *types.MessagePaymentFailedEvent

Payment failed notification event

func NewMessagePaymentSuccessEvent

func NewMessagePaymentSuccessEvent(
	userId int64,
	orderNo string,
	paymentNo string,
	amount float64,
	channel string,
	templateId int64,
) *types.MessagePaymentSuccessEvent

Payment success notification event

func NewMessageTemplateEvent

func NewMessageTemplateEvent(
	userId int64,
	template types.MessageTemplate,
	action string,
	eventType types.MessageEventType,
) *types.MessageTemplateEvent

Template message events

Types

type MessageProducer

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

func NewMessageProducer

func NewMessageProducer(ch *amqp.Channel, exchange string) *MessageProducer

func (*MessageProducer) Close

func (p *MessageProducer) Close() error

func (*MessageProducer) PublishBatchEvent

func (p *MessageProducer) PublishBatchEvent(ctx context.Context, event *types.MessageBatchEvent) error

func (*MessageProducer) PublishMessageEvent

func (p *MessageProducer) PublishMessageEvent(ctx context.Context, event *types.MessageEventSentEvent) error

func (*MessageProducer) PublishPaymentFailedEvent

func (p *MessageProducer) PublishPaymentFailedEvent(ctx context.Context, event *types.MessagePaymentFailedEvent) error

func (*MessageProducer) PublishPaymentSuccessEvent

func (p *MessageProducer) PublishPaymentSuccessEvent(ctx context.Context, event *types.MessagePaymentSuccessEvent) error

func (*MessageProducer) PublishTemplateEvent

func (p *MessageProducer) PublishTemplateEvent(ctx context.Context, event *types.MessageTemplateEvent) error

Jump to

Keyboard shortcuts

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