pub_sub

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AMQPConfig

type AMQPConfig struct {
	Exchange     string
	ExchangeType string
}

type Bus

type Bus interface {
	// Subscribe to the specified topic.
	Subscribe(topic string, cb func(data interface{}), options *QueueOptions) (func(), error)

	// Notify notifies the topic with the optional data
	Notify(topic string, data interface{}) error

	// DeleteQueue deletes a queue
	DeleteQueue(id string) error
}

Bus is an interface used for pub-sub like interactions

func NewRabbitBus

func NewRabbitBus(cfg *RabbitMQConfig) (Bus, error)

type QueueOptions

type QueueOptions struct {
	Durable    bool
	AutoDelete bool
	Exclusive  bool
	NoWait     bool
}

type RabbitMQConfig

type RabbitMQConfig struct {
	RabbitMQUser     string
	RabbitMQPassword string
	RabbitMQHost     string
	RabbitMQPort     string
	AMQP             AMQPConfig

	Environment string
}

Jump to

Keyboard shortcuts

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