config

package
v0.0.0-...-d1f23fe Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetDefaultQueueDurability

func SetDefaultQueueDurability(cfg *Config)

SetDefaultQueueDurability sets queue durable to true to keep backwards compatibility

Types

type Config

type Config struct {
	RabbitMq struct {
		AmqpUrl      string
		Host         string
		Username     string
		Password     string
		Port         string
		Vhost        string
		Queue        string
		Compression  bool
		Onfailure    int
		Stricfailure bool
	}
	Prefetch struct {
		Count  int
		Global bool
	}
	QueueSettings struct {
		Routingkey           []string
		MessageTTL           int
		DeadLetterExchange   string
		DeadLetterRoutingKey string
		Priority             int
		Nodeclare            bool
		Durable              bool
		Exclusive            bool
		AutoDelete           bool
		NoWait               bool
	}
	Exchange struct {
		Name       string
		Autodelete bool
		Type       string
		Durable    bool
	}
	Logs struct {
		Error      string
		Info       string
		NoDateTime bool
		Verbose    bool
	}
}

func CreateFromString

func CreateFromString(data string) (*Config, error)

func LoadAndParse

func LoadAndParse(location string) (*Config, error)

LoadAndParse creates a new instance of config by parsing the content of teh given file.

func (*Config) AmqpUrl

func (c *Config) AmqpUrl() string

func (Config) ConsumerTag

func (c Config) ConsumerTag() string

ConsumerTag returns the tag used to identify the consumer.

func (Config) DeadLetterExchange

func (c Config) DeadLetterExchange() string

DeadLetterExchange returns the configured dead letter exchange name.

func (Config) DeadLetterRoutingKey

func (c Config) DeadLetterRoutingKey() string

DeadLetterRoutingKey returns the configured key for the dead letter routing.

func (Config) ExchangeIsAutoDelete

func (c Config) ExchangeIsAutoDelete() bool

ExchangeIsAutoDelete return whether the exchange should be auto deleted or not.

func (Config) ExchangeIsDurable

func (c Config) ExchangeIsDurable() bool

ExchangeIsDurable returns whether the exchange should be durable or not.

func (Config) ExchangeName

func (c Config) ExchangeName() string

ExchangeName returns the name of the configured exchange.

func (Config) ExchangeType

func (c Config) ExchangeType() string

ExchangeType checks the configuration and returns the appropriate exchange type.

func (Config) HasDeadLetterExchange

func (c Config) HasDeadLetterExchange() bool

HasDeadLetterExchange checks if a dead letter exchange is configured.

func (Config) HasDeadLetterRouting

func (c Config) HasDeadLetterRouting() bool

HasDeadLetterRouting checks if a dead letter routing key is configured.

func (Config) HasExchange

func (c Config) HasExchange() bool

HasExchange checks if an exchange is configured.

func (Config) HasMessageTTL

func (c Config) HasMessageTTL() bool

HasMessageTTL checks if a message TTL is configured.

func (Config) HasPriority

func (c Config) HasPriority() bool

HasPriority checks if priority is configured

func (Config) IsVerbose

func (c Config) IsVerbose() bool

IsVerbose checks if verbose logging is enabled.

func (Config) MessageTTL

func (c Config) MessageTTL() int32

MessageTTL returns the configured message TTL.

func (Config) MustDeclareQueue

func (c Config) MustDeclareQueue() bool

MustDeclareQueue return if the consumer should declare the queue or if the queue is expected to be already declared.

func (Config) PrefetchCount

func (c Config) PrefetchCount() int

PrefetchCount returns the configured prefetch count of the QoS settings.

func (Config) PrefetchIsGlobal

func (c Config) PrefetchIsGlobal() bool

PrefetchIsGlobal returns if the prefetch count is defined globally for all consumers or locally for just each single consumer.

func (Config) Priority

func (c Config) Priority() int32

Priority returns the priority

func (Config) QueueIsAutoDelete

func (c Config) QueueIsAutoDelete() bool

QueueIsAutoDelete checks if queue should be declared 'autoDelete'

func (Config) QueueIsDurable

func (c Config) QueueIsDurable() bool

QueueIsDurable checks if queue should be declared durable. Defaults to true to keep backwards compatibility

func (Config) QueueIsExclusive

func (c Config) QueueIsExclusive() bool

QueueIsExclusive checks if queue should be declared exclusive

func (Config) QueueIsNoWait

func (c Config) QueueIsNoWait() bool

QueueIsNoWait checks if queue should be declared 'noWait'

func (Config) QueueName

func (c Config) QueueName() string

QueueName returns the name of toe queue to bind with.

func (Config) RoutingKeys

func (c Config) RoutingKeys() []string

RoutingKeys returns the configured keys for message routing.

func (Config) WithDateTime

func (c Config) WithDateTime() bool

WithDateTime checks if log entries should be logged with date and time.

Jump to

Keyboard shortcuts

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