flux_adapters v0.1.0 FluxAdapters.Plug

Link to this section Summary

Functions

Sends a chunk in the chunked response

Reads the request body

Sends the given status, headers as the beginning of a chunked response to the client

Sends the given status, headers and file as a response back to the client

Sends the given status, headers and body as a response back to the client

Link to this section Functions

Link to this function chunk(conn, arg)

Sends a chunk in the chunked response.

If the request has method "HEAD", the adapter should not send the response to the client.

Webservers are advised to return :ok and not modify any further state for each chunk. However, the test implementation returns the actual body and payload so it can be used during testing.

Callback implementation for Plug.Conn.Adapter.chunk/2.

Link to this function get_peer_data(map)
Link to this function read_req_body(conn, arg)

Reads the request body.

Read the docs in Plug.Conn.read_body/2 for the supported options and expected behaviour.

Callback implementation for Plug.Conn.Adapter.read_req_body/2.

Link to this function send_chunked(conn, arg1, arg2)

Sends the given status, headers as the beginning of a chunked response to the client.

Webservers are advised to return nil as the sent_body, as the body can no longer be manipulated. However, the test implementation returns the actual body so it can be used during testing.

Callback implementation for Plug.Conn.Adapter.send_chunked/3.

Link to this function send_file(conn, status, headers, file, offset, length)

Sends the given status, headers and file as a response back to the client.

If the request has method "HEAD", the adapter should not send the response to the client.

Webservers are advised to return nil as the sent_body, as the body can no longer be manipulated. However, the test implementation returns the actual body so it can be used during testing.

Callback implementation for Plug.Conn.Adapter.send_file/6.

Link to this function send_resp(conn, status, headers, body)

Sends the given status, headers and body as a response back to the client.

If the request has method "HEAD", the adapter should not send the response to the client.

Webservers are advised to return nil as the sent_body, as the body can no longer be manipulated. However, the test implementation returns the actual body so it can be used during testing.

Callback implementation for Plug.Conn.Adapter.send_resp/4.

Link to this function upgrade(conn, endpoint)