Conduit v0.12.10 Conduit.Plug.Builder View Source

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"

Link to this section Summary

Functions

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

Link to this section Types

Link to this section Functions

Link to this macro plug(plug, opts \\ []) View Source (macro)

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