# `AmqpSidecar.Broker`

Behaviour abstracting the AMQP client.

The production implementation (`AmqpSidecar.Broker.AMQP`) talks to RabbitMQ.
Tests inject `AmqpSidecar.Broker.Mock` (Mox) via
`Application.get_env(:amqp_sidecar, :broker)`.

# `channel`

```elixir
@type channel() :: term()
```

# `connection`

```elixir
@type connection() :: term()
```

# `ack`

```elixir
@callback ack(channel(), non_neg_integer()) :: :ok | {:error, term()}
```

# `bind_queue`

```elixir
@callback bind_queue(channel(), String.t(), String.t(), keyword()) ::
  :ok | {:error, term()}
```

# `close_channel`

```elixir
@callback close_channel(channel()) :: :ok | {:error, term()}
```

# `close_connection`

```elixir
@callback close_connection(connection()) :: :ok | {:error, term()}
```

# `consume`

```elixir
@callback consume(channel(), String.t()) :: {:ok, String.t()} | {:error, term()}
```

# `declare_exchange`

```elixir
@callback declare_exchange(channel(), String.t(), String.t(), keyword()) ::
  :ok | {:error, term()}
```

# `declare_queue`

```elixir
@callback declare_queue(channel(), String.t(), keyword()) ::
  {:ok, map()} | {:error, term()}
```

# `open_channel`

```elixir
@callback open_channel(connection()) :: {:ok, channel()} | {:error, term()}
```

# `open_connection`

```elixir
@callback open_connection(String.t()) :: {:ok, connection()} | {:error, term()}
```

# `publish`

```elixir
@callback publish(channel(), String.t(), String.t(), String.t(), keyword()) ::
  :ok | {:error, term()}
```

# `reject`

```elixir
@callback reject(channel(), non_neg_integer(), keyword()) :: :ok | {:error, term()}
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
