mqs

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2026 License: Apache-2.0 Imports: 24 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSQueue

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

func NewAWSQueue

func NewAWSQueue(config *AWSSQSConfig) *AWSQueue

func (*AWSQueue) Init

func (q *AWSQueue) Init(ctx context.Context) (func(), error)

func (*AWSQueue) InitSDK

func (q *AWSQueue) InitSDK(ctx context.Context) error

func (*AWSQueue) Publish

func (q *AWSQueue) Publish(ctx context.Context, incomingMessage IncomingMessage) error

func (*AWSQueue) Subscribe

func (q *AWSQueue) Subscribe(ctx context.Context) (Subscription, error)

type AWSSQSConfig

type AWSSQSConfig struct {
	Endpoint                  string // optional - dev-focused
	Region                    string
	ServiceAccountCredentials string
	Topic                     string
}

func (*AWSSQSConfig) ToCredentials

type AzureServiceBusConfig

type AzureServiceBusConfig struct {
	Topic        string
	Subscription string
	DLQ          bool // Set to true to subscribe to the dead letter queue

	// Credentials
	ConnectionString string
	// or
	TenantID       string
	ClientID       string
	ClientSecret   string
	SubscriptionID string
	ResourceGroup  string
	Namespace      string
}

type AzureServiceBusQueue added in v0.3.0

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

func NewAzureServiceBusQueue added in v0.3.0

func NewAzureServiceBusQueue(config *AzureServiceBusConfig) *AzureServiceBusQueue

func (*AzureServiceBusQueue) Init added in v0.3.0

func (q *AzureServiceBusQueue) Init(ctx context.Context) (func(), error)

func (*AzureServiceBusQueue) InitClient added in v0.3.0

func (q *AzureServiceBusQueue) InitClient(ctx context.Context) error

func (*AzureServiceBusQueue) Publish added in v0.3.0

func (q *AzureServiceBusQueue) Publish(ctx context.Context, incomingMessage IncomingMessage) error

func (*AzureServiceBusQueue) Subscribe added in v0.3.0

func (q *AzureServiceBusQueue) Subscribe(ctx context.Context) (Subscription, error)

type GCPPubSubConfig

type GCPPubSubConfig struct {
	ProjectID                 string
	TopicID                   string
	SubscriptionID            string
	ServiceAccountCredentials string // JSON key file content
}

type GCPPubSubQueue

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

func NewGCPPubSubQueue

func NewGCPPubSubQueue(config *GCPPubSubConfig) *GCPPubSubQueue

func (*GCPPubSubQueue) Init

func (q *GCPPubSubQueue) Init(ctx context.Context) (func(), error)

func (*GCPPubSubQueue) Publish

func (q *GCPPubSubQueue) Publish(ctx context.Context, incomingMessage IncomingMessage) error

func (*GCPPubSubQueue) Subscribe

func (q *GCPPubSubQueue) Subscribe(ctx context.Context) (Subscription, error)

type InMemoryConfig

type InMemoryConfig struct {
	Name string
}

type InMemoryQueue

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

func NewInMemoryQueue

func NewInMemoryQueue(config *InMemoryConfig) *InMemoryQueue

func (*InMemoryQueue) Init

func (q *InMemoryQueue) Init(ctx context.Context) (func(), error)

func (*InMemoryQueue) Publish

func (q *InMemoryQueue) Publish(ctx context.Context, incomingMessage IncomingMessage) error

func (*InMemoryQueue) Subscribe

func (q *InMemoryQueue) Subscribe(ctx context.Context) (Subscription, error)

type IncomingMessage

type IncomingMessage interface {
	ToMessage() (*Message, error)
	FromMessage(msg *Message) error
}

type Message

type Message struct {
	QueueMessage
	LoggableID string
	Body       []byte
}

type Queue

type Queue interface {
	Init(ctx context.Context) (func(), error)
	Publish(ctx context.Context, msg IncomingMessage) error
	Subscribe(ctx context.Context) (Subscription, error)
}

func NewQueue

func NewQueue(config *QueueConfig) Queue

type QueueConfig

type QueueConfig struct {
	AWSSQS          *AWSSQSConfig
	AzureServiceBus *AzureServiceBusConfig
	GCPPubSub       *GCPPubSubConfig
	RabbitMQ        *RabbitMQConfig
	InMemory        *InMemoryConfig // mainly for testing purposes
}

type QueueMessage

type QueueMessage interface {
	Ack()
	Nack()
}

type RabbitMQConfig

type RabbitMQConfig struct {
	ServerURL string
	Exchange  string // optional
	Queue     string
}

type RabbitMQQueue

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

func NewRabbitMQQueue

func NewRabbitMQQueue(config *RabbitMQConfig) *RabbitMQQueue

func (*RabbitMQQueue) Init

func (q *RabbitMQQueue) Init(ctx context.Context) (func(), error)

func (*RabbitMQQueue) InitConn

func (q *RabbitMQQueue) InitConn() error

func (*RabbitMQQueue) Publish

func (q *RabbitMQQueue) Publish(ctx context.Context, incomingMessage IncomingMessage) error

func (*RabbitMQQueue) Subscribe

func (q *RabbitMQQueue) Subscribe(ctx context.Context) (Subscription, error)

type Subscription

type Subscription interface {
	Receive(ctx context.Context) (*Message, error)
	Shutdown(ctx context.Context) error
}

type UnimplementedQueue

type UnimplementedQueue struct{}

func (*UnimplementedQueue) Init

func (q *UnimplementedQueue) Init(ctx context.Context) (func(), error)

func (*UnimplementedQueue) Publish

func (*UnimplementedQueue) Subscribe

func (q *UnimplementedQueue) Subscribe(ctx context.Context) (Subscription, error)

type WrappedSubscription

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

func (*WrappedSubscription) Receive

func (s *WrappedSubscription) Receive(ctx context.Context) (*Message, error)

func (*WrappedSubscription) Shutdown

func (s *WrappedSubscription) Shutdown(ctx context.Context) error

Jump to

Keyboard shortcuts

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