exchange

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2019 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package exchange takes care of RabbitMQ Exchange declarations. If the type Exchange were to be used directly it would end-up like:

Exchange{
  Name: "",
  Kind: "",
  Durable: false,
  AutoDelete: false,
  Internal: false,
  NoWait: false,
  Args: nil,
}

Becase of that, the New method allows better sensible options, so it would be this:

Exchange{
  Name: "",
  Kind: "direct",
  Durable: true,
  AutoDelete: false,
  Internal: false,
  NoWait: false,
  Args: nil,
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Exchange

type Exchange struct {
	Name string

	// Possible options are direct, fanout, topic and headers.
	Kind string

	Durable    bool
	AutoDelete bool
	Internal   bool
	NoWait     bool
	Args       amqp.Table
}

Exchange holds the definition of an AMQP exchange.

func New

func New(name string, opts ...Option) Exchange

New returns an Exchange definition with the following defaults unless changed via the Option options.

Exchange{
  Name: "passedname",
  Kind: "direct",
  Durable: true,
  AutoDelete: false,
  Internal: false,
  NoWait: false,
  Args: nil,
}

type Option

type Option func(Exchange) Exchange

func Args

func Args(v amqp.Table) Option

func AutoDelete

func AutoDelete() Option

func Internal

func Internal() Option

func Kind

func Kind(k string) Option

Kind changes the kind of an Exchange from the "direct" default.

func NoDurable

func NoDurable() Option

NoDurable changes the durability of an Exchange from the true default.

func NoWait

func NoWait() Option

Jump to

Keyboard shortcuts

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