Plug v0.12.1

Modules summary

Plug

The plug specification

Plug.Adapters.Cowboy

Adapter interface to the Cowboy webserver

Plug.Adapters.Translator

A translator module shared by adapters that ship with Plug

Plug.Builder

Conveniences for building plugs

Plug.CSRFProtection

Plug to protect from cross-site request forgery

Plug.Conn

The Plug connection

Plug.Conn.Adapter

Specification of the connection adapter API implemented by webservers

Plug.Conn.Cookies

Conveniences for encoding and decoding cookies

Plug.Conn.Query

Conveniences for decoding and encoding url encoded queries

Plug.Conn.Status

Conveniences for working with status codes

Plug.Conn.Unfetched

A struct used as default on unfetched fields

Plug.Conn.Utils

Utilities for working with connection data

Plug.Crypto

Namespace and module for cyrpto functionality

Plug.Crypto.KeyGenerator

KeyGenerator is a simple implementation of PBFDF2

Plug.Crypto.MessageEncryptor

MessageEncryptor is a simple way to encrypt values which get stored somewhere you don’t trust

Plug.Crypto.MessageVerifier

MessageVerifier makes it easy to generate and verify messages which are signed to prevent tampering

Plug.Debugger

A module (not a plug) for debugging in development

Plug.ErrorHandler

A module to be used in your existing plugs in order to provide error handling

Plug.Head

A Plug to convert HEAD requests to GET requests

Plug.Logger

A plug for logging basic request information

Plug.MIME

Maps MIME types to file extensions and vice versa

Plug.MethodOverride

This plug overrides the request’s POST method with the method defined in the _method request parameter

Plug.Parsers

A plug for parsing the request body

Plug.Parsers.JSON

Parses JSON request body

Plug.Parsers.MULTIPART

Parses multipart request body

Plug.Parsers.URLENCODED

Parses urlencoded request body

Plug.Router

A DSL to define a routing algorithm that works with Plug

Plug.SSL

A plug to force SSL

Plug.Session

A plug to handle session cookies and session stores

Plug.Session.COOKIE

Stores the session in a cookie

Plug.Session.ETS

Stores the session in an in-memory ETS table

Plug.Session.Store

Specification for session stores

Plug.Static

A plug for serving static assets

Plug.Test

Conveniences for testing plugs

Plug.Upload

A server (a GenServer specifically) that manages uploaded files

Exceptions summary

Plug.CSRFProtection.InvalidCSRFTokenError

Error raised when CSRF token is invalid

Plug.CSRFProtection.InvalidCrossOriginRequestError

Error raised when non-XHR requests are used for Javascript responses

Plug.Conn.AlreadySentError

Error raised when trying to modify or send an already sent response

Plug.Conn.NotSentError

Error raised when no response is sent in a request

Plug.Conn.WrapperError

Wraps the connection in an error which is meant to be handled upper in the stack

Plug.Parsers.BadEncodingError

Raised when the request body contains bad encoding

Plug.Parsers.ParseError

Error raised when the request body is malformed

Plug.Parsers.RequestTooLargeError

Error raised when the request is too large

Plug.Parsers.UnsupportedMediaTypeError

Error raised when the request body cannot be parsed

Plug.Router.InvalidSpecError
Plug.Static.InvalidPathError

Protocols summary

Plug.Exception

A protocol that extends exceptions to be status-code aware