rabbitmq

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultLifetime = 5 * time.Minute
	DefaultHostname = "localhost"
	DefaultPort     = 5672
	DefaultUsername = "guest"
	DefaultPassword = "guest"
	DefaultLogger   = log.Discard
)

The default client configuration

Variables

This section is empty.

Functions

func New

func New(ctx context.Context, cfg *Config) (driver.Interface, error)

New returns a new queue server based on RabbitMQ with the given configuration

Types

type Config

type Config struct {
	Lifetime time.Duration    // The length of time after which a message is automatically requeued
	Address  *address.Address // The address of the RabbitMQ server
	Username string           // The username for RabbitMQ
	Password string           // The password for RabbitMQ
	Logger   log.Interface    // The logger
}

Config describes the configuration options we allow a user to set on a RabbitMQ driver.

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns a new client configuration initialised with the default values.

func SetDefaultConfig

func SetDefaultConfig(c *Config) *Config

SetDefaultConfig sets the default configuration to c and returns the old default configuration. This change will be reflected in future calls to DefaultConfig.

func (*Config) Copy

func (c *Config) Copy() *Config

Copy returns a copy of the configuration.

func (*Config) URI

func (c *Config) URI() string

URI returns the AQMP URI specified by c.

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the configuration, returning an error if there's a problem.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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