amqp

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MailRequest

type MailRequest struct {
	From         string         `json:"from"`
	To           string         `json:"to"`
	Subject      string         `json:"subject"`
	DataMap      map[string]any `json:"data_map"`
	TemplateName string         `json:"template_name"`
	AckRequired  bool           `json:"ack_required"`
	Priority     string         `json:"priority"`
}

type MailResponse

type MailResponse struct {
	Status        bool   `json:"status"`
	Message       string `json:"message"`
	CorrelationId string `json:"correlation_id"`
}

type RabbitAMQPClient

type RabbitAMQPClient struct {
	Conn         *amqp.Connection
	Ch           *amqp.Channel
	LogExName    string // exchange name for logs
	TracExName   string // exchange name for tracker
	MailReqQName string // routing key for sending mail
	MailResQName string
	SMSReqQName  string // routing key for sending mail
	SMSResQName  string
}

func Get

func Get() *RabbitAMQPClient

func (*RabbitAMQPClient) SendMail

func (r *RabbitAMQPClient) SendMail(msg []byte, cb func(MailResponse)) (string, error)

func (*RabbitAMQPClient) SendSMS added in v1.1.7

func (r *RabbitAMQPClient) SendSMS(msg []byte, cb func(SMSResponse)) (string, error)

func (*RabbitAMQPClient) Stop

func (a *RabbitAMQPClient) Stop()

func (*RabbitAMQPClient) TrackEvent

func (a *RabbitAMQPClient) TrackEvent(e []byte, sender, name string) error

func (*RabbitAMQPClient) Write

func (a *RabbitAMQPClient) Write(p []byte) (int, error)

type SMSRequest added in v1.1.7

type SMSRequest struct {
	From         string         `json:"from"`
	To           string         `json:"to"`
	CountryCode  string         `json:"country_code"`
	Name         string         `json:"name"`
	Subject      string         `json:"subject"`
	DataMap      map[string]any `json:"data_map"`
	TemplateName string         `json:"template_name"`
	AckRequired  bool           `json:"ack_required"`
	Priority     string         `json:"priority"`
}

type SMSResponse added in v1.1.7

type SMSResponse struct {
	Status        bool   `json:"status"`
	Message       string `json:"message"`
	CorrelationId string `json:"correlation_id"`
}

type TrackEvent

type TrackEvent struct {
	Sender    string    `json:"sender"`
	EventName string    `json:"event_name"`
	EventData string    `json:"event_data"`
	CreatedAt time.Time `json:"created_at"`
}

Jump to

Keyboard shortcuts

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