Documentation ¶
Index ¶
- Constants
- type BchPaymentConfirmation
- type DashPaymentConfirmation
- type ENSRequest
- type ENSRequestType
- type EmailSend
- type EthPaymentConfirmation
- type Manager
- func (qm *Manager) Close() error
- func (qm *Manager) ConsumeMessages(ctx context.Context, wg *sync.WaitGroup, db *gorm.DB, ...) error
- func (qm *Manager) ProcessBCHPayment(ctx context.Context, wg *sync.WaitGroup, msgs <-chan amqp.Delivery) error
- func (qm *Manager) ProcessDASHPayment(ctx context.Context, wg *sync.WaitGroup, msgs <-chan amqp.Delivery) error
- func (qm *Manager) ProcessENSRequest(ctx context.Context, wg *sync.WaitGroup, msgs <-chan amqp.Delivery) error
- func (qm *Manager) ProcessETHPayment(ctx context.Context, wg *sync.WaitGroup, msgs <-chan amqp.Delivery) error
- func (qm *Manager) PublishMessage(body interface{}) error
- func (qm *Manager) RegisterConnectionClosure()
- type Queue
Constants ¶
const ( // ENSRegisterName is a name registration request message ENSRegisterName = ENSRequestType("register-name") // ENSRegisterSubName is a subdomain name registration request message ENSRegisterSubName = ENSRequestType("regsiter-sub-name") // ENSUpdateContentHash is used to update the content hash for a record ENSUpdateContentHash = ENSRequestType("update-content-hash") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BchPaymentConfirmation ¶
type BchPaymentConfirmation struct { UserName string `json:"user_name"` PaymentNumber int64 `json:"payment_number"` }
BchPaymentConfirmation is used to confirm a bitcoin cash based payment
type DashPaymentConfirmation ¶
type DashPaymentConfirmation struct { UserName string `json:"user_name"` PaymentForwardID string `json:"payment_forward_id"` PaymentNumber int64 `json:"payment_number"` }
DashPaymentConfirmation is a message used to signal processing of a dash payment
type ENSRequest ¶
type ENSRequest struct { Type ENSRequestType `json:"type"` UserName string `json:"user_name"` ContentHash string `json:"content_hash"` }
ENSRequest is used to process an ens api request
type ENSRequestType ¶
type ENSRequestType string
ENSRequestType denotes a particular request type
func (ENSRequestType) String ¶
func (ert ENSRequestType) String() string
type EmailSend ¶
type EmailSend struct { Subject string `json:"subject"` Content string `json:"content"` ContentType string `json:"content_type"` UserNames []string `json:"user_names"` Emails []string `json:"emails,omitempty"` }
EmailSend is a helper struct used to contained formatted content ot send as an email
type EthPaymentConfirmation ¶
type EthPaymentConfirmation struct { UserName string `json:"user_name"` PaymentNumber int64 `json:"payment_number"` }
EthPaymentConfirmation is a message used to confirm an ethereum based payment
type Manager ¶
type Manager struct { ErrCh chan *amqp.Error QueueName Queue ExchangeName string // contains filtered or unexported fields }
Manager is a helper struct to interact with rabbitmq
func New ¶
func New(queue Queue, cfg *config.TemporalConfig, logger *zap.SugaredLogger, publish bool) (*Manager, error)
New is used to instantiate a new connection to rabbitmq as a publisher or consumer
func (*Manager) ConsumeMessages ¶
func (qm *Manager) ConsumeMessages(ctx context.Context, wg *sync.WaitGroup, db *gorm.DB, cfg *config.TemporalConfig) error
ConsumeMessages is used to consume messages that are sent to the queue Question, do we really want to ack messages that fail to be processed? Perhaps the error was temporary, and we allow it to be retried?
func (*Manager) ProcessBCHPayment ¶
func (qm *Manager) ProcessBCHPayment(ctx context.Context, wg *sync.WaitGroup, msgs <-chan amqp.Delivery) error
ProcessBCHPayment is used to handle processing of BCH based payments
func (*Manager) ProcessDASHPayment ¶
func (qm *Manager) ProcessDASHPayment(ctx context.Context, wg *sync.WaitGroup, msgs <-chan amqp.Delivery) error
ProcessDASHPayment is used to process dash based payments
func (*Manager) ProcessENSRequest ¶
func (qm *Manager) ProcessENSRequest( ctx context.Context, wg *sync.WaitGroup, msgs <-chan amqp.Delivery, ) error
ProcessENSRequest is used to process ens requests
func (*Manager) ProcessETHPayment ¶
func (qm *Manager) ProcessETHPayment(ctx context.Context, wg *sync.WaitGroup, msgs <-chan amqp.Delivery) error
ProcessETHPayment is used to process ethereum and rtc based payments
func (*Manager) PublishMessage ¶
PublishMessage is used to produce messages that are sent to the queue, with a worker queue (one consumer)
func (*Manager) RegisterConnectionClosure ¶
func (qm *Manager) RegisterConnectionClosure()
RegisterConnectionClosure is used to register a channel which we may receive connection level errors. This covers all channel, and connection errors.
type Queue ¶
type Queue string
Queue is a typed string used to declare the various queue names
var ( // ENSRequestQueue is a queue used to handle ens requests ENSRequestQueue Queue = "ens-request-queue" // EmailSendQueue is a queue used to handle sending email messages EmailSendQueue Queue = "email-send-queue" // DashPaymentConfirmationQueue is a queue used to handle confirming dash payments DashPaymentConfirmationQueue Queue = "dash-payment-confirmation-queue" // EthPaymentConfirmationQueue is a queue used to handle ethereum based payment confirmations EthPaymentConfirmationQueue Queue = "eth-payment-confirmation-queue" // BitcoinCashPaymentConfirmationQueue is a queue used to handle confirming bitcoin cash payments BitcoinCashPaymentConfirmationQueue Queue = "bitcoin-cash-payment-confirmation-queue" // ErrReconnect is an error emitted when a protocol connection error occurs // It is used to signal reconnect of queue consumers and publishers ErrReconnect = "protocol connection error, reconnect" )