utilities

package
v0.0.0-...-2f5affc Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectMongo

func ConnectMongo(uri string, maxRetries int, retryDelay time.Duration) (*mongo.Client, error)

Types

type Digits

type Digits int
const (
	OtpInterval        = 30 // Interval in seconds
	SixDigits   Digits = 6  // Number of digits in the OTP code
	EightDigits Digits = 8
)

func (Digits) Length

func (d Digits) Length() int

type OTPUtilities

type OTPUtilities interface {
	TOTPToken(counter int64, digits Digits) (int, error)
}

func NewOtpUtilities

func NewOtpUtilities(key []byte) OTPUtilities

type RabbitMQ

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

func NewRabbitMQ

func NewRabbitMQ(url string) (*RabbitMQ, error)

func (*RabbitMQ) BindQueue

func (mq *RabbitMQ) BindQueue(queueName string, exchangeName string, routingKey string) error

func (*RabbitMQ) Close

func (mq *RabbitMQ) Close() error

func (*RabbitMQ) Consume

func (mq *RabbitMQ) Consume(queueName string, consumerName string, autoAck bool) (<-chan amqp.Delivery, error)

func (*RabbitMQ) DeclareExchange

func (mq *RabbitMQ) DeclareExchange(name string, kind string, durable bool) error

func (*RabbitMQ) DeclareQueue

func (mq *RabbitMQ) DeclareQueue(name string, durable bool) (amqp.Queue, error)

func (*RabbitMQ) Publish

func (mq *RabbitMQ) Publish(exchange string, routingKey string, mandatory bool, immediate bool, msg amqp.Publishing) error

Jump to

Keyboard shortcuts

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