Conduit v0.7.0 Conduit.Plug.Builder

A module that can be used to build plugs.

You can also use plugs within your custom plug. The plugs will be run before call/3.

Examples

iex> import Conduit.Message
iex>
iex> defmodule MyPipeline do
iex>   use Conduit.Plug.Builder
iex>
iex>   plug Conduit.Plug.Format
iex>   plug Conduit.Plug.Encode
iex> end
iex>
iex> message =
iex>   %Conduit.Message{}
iex>   |> put_body("hi")
iex>   |> MyPipeline.run
iex> message.body
"hi"
iex> message.content_type
"text/plain"
iex> message.content_encoding
"identity"

Summary

Macros

A macro that stores a new plug. opts will be passed unchanged to the new plug

Types

plug()
plug :: module | atom

Macros

plug(plug, opts \\ [])

A macro that stores a new plug. opts will be passed unchanged to the new plug.

Examples

plug Conduit.Plug.Format                  # plug module
plug :put_content_encoding, "gzip"        # plug function