Documentation ¶
Index ¶
- type AMQPClient
- type AMQPListenOptions
- type Client
- type ClientConfig
- type ClientOption
- func WithLndHubInvoiceExchange(exchange string) ClientOption
- func WithLndInvoiceConsumerQueueName(name string) ClientOption
- func WithLndInvoiceExchange(exchange string) ClientOption
- func WithLndPaymentConsumerQueueName(name string) ClientOption
- func WithLndPaymentExchange(exchange string) ClientOption
- func WithLogger(logger *lecho.Logger) ClientOption
- type DefaultClient
- func (client *DefaultClient) Close() error
- func (client *DefaultClient) FinalizeInitializedPayments(ctx context.Context, svc LndHubService) error
- func (client *DefaultClient) PublishToLndhubExchange(ctx context.Context, invoice models.Invoice, ...) error
- func (client *DefaultClient) StartPublishInvoices(ctx context.Context, invoicesSubscribeFunc SubscribeToInvoicesFunc, ...) error
- func (client *DefaultClient) SubscribeToLndInvoices(ctx context.Context, handler IncomingInvoiceHandler) error
- type DialOption
- type EncodeOutgoingInvoiceFunc
- type IncomingInvoiceHandler
- type ListenOptions
- type LndHubService
- type SubscribeToInvoicesFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AMQPClient ¶
type AMQPClient interface { Listen(ctx context.Context, exchange string, routingKey string, queueName string, options ...AMQPListenOptions) (<-chan amqp.Delivery, error) PublishWithContext(ctx context.Context, exchange, key string, mandatory, immediate bool, msg amqp.Publishing) error ExchangeDeclare(name, kind string, durable, autoDelete, internal, noWait bool, args amqp.Table) error Close() error }
func DialAMQP ¶
func DialAMQP(uri string, options ...DialOption) (AMQPClient, error)
type AMQPListenOptions ¶
type AMQPListenOptions = func(opts ListenOptions) ListenOptions
func WithAutoAck ¶
func WithAutoAck(autoAck bool) AMQPListenOptions
func WithAutoDelete ¶
func WithAutoDelete(autoDelete bool) AMQPListenOptions
func WithDurable ¶
func WithDurable(durable bool) AMQPListenOptions
func WithExclusive ¶
func WithExclusive(exclusive bool) AMQPListenOptions
func WithInternal ¶
func WithInternal(internal bool) AMQPListenOptions
func WithWait ¶
func WithWait(wait bool) AMQPListenOptions
type Client ¶
type Client interface { SubscribeToLndInvoices(context.Context, IncomingInvoiceHandler) error StartPublishInvoices(context.Context, SubscribeToInvoicesFunc, EncodeOutgoingInvoiceFunc) error FinalizeInitializedPayments(context.Context, LndHubService) error // Close will close all connections to rabbitmq Close() error }
func NewClient ¶
func NewClient(amqpClient AMQPClient, options ...ClientOption) (Client, error)
Dial sets up a connection to rabbitmq with two channels that are ready to produce and consume
type ClientConfig ¶
type ClientConfig struct {
// contains filtered or unexported fields
}
type ClientOption ¶
type ClientOption = func(client *DefaultClient)
func WithLndHubInvoiceExchange ¶
func WithLndHubInvoiceExchange(exchange string) ClientOption
func WithLndInvoiceConsumerQueueName ¶
func WithLndInvoiceConsumerQueueName(name string) ClientOption
func WithLndInvoiceExchange ¶
func WithLndInvoiceExchange(exchange string) ClientOption
func WithLndPaymentConsumerQueueName ¶
func WithLndPaymentConsumerQueueName(name string) ClientOption
func WithLndPaymentExchange ¶
func WithLndPaymentExchange(exchange string) ClientOption
func WithLogger ¶
func WithLogger(logger *lecho.Logger) ClientOption
type DefaultClient ¶
type DefaultClient struct {
// contains filtered or unexported fields
}
func (*DefaultClient) Close ¶
func (client *DefaultClient) Close() error
func (*DefaultClient) FinalizeInitializedPayments ¶
func (client *DefaultClient) FinalizeInitializedPayments(ctx context.Context, svc LndHubService) error
func (*DefaultClient) PublishToLndhubExchange ¶
func (client *DefaultClient) PublishToLndhubExchange(ctx context.Context, invoice models.Invoice, payloadFunc EncodeOutgoingInvoiceFunc) error
func (*DefaultClient) StartPublishInvoices ¶
func (client *DefaultClient) StartPublishInvoices(ctx context.Context, invoicesSubscribeFunc SubscribeToInvoicesFunc, payloadFunc EncodeOutgoingInvoiceFunc) error
func (*DefaultClient) SubscribeToLndInvoices ¶
func (client *DefaultClient) SubscribeToLndInvoices(ctx context.Context, handler IncomingInvoiceHandler) error
type DialOption ¶
type DialOption = func(*defaultAMQPCLient)
func WithAmqpLogger ¶
func WithAmqpLogger(logger *lecho.Logger) DialOption
type IncomingInvoiceHandler ¶
type ListenOptions ¶
type LndHubService ¶
type LndHubService interface { HandleFailedPayment(context.Context, *models.Invoice, models.TransactionEntry, error) error HandleSuccessfulPayment(context.Context, *models.Invoice, models.TransactionEntry) error GetAllPendingPayments(context.Context) ([]models.Invoice, error) GetTransactionEntryByInvoiceId(context.Context, int64) (models.TransactionEntry, error) }
Directories ¶
Path | Synopsis |
---|---|
Package mock_rabbitmq is a generated GoMock package.
|
Package mock_rabbitmq is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.