Ankh.Protocol protocol (ankh v0.17.0)
HTTP Protocol interface
HTTP protocol versions implement this protocol and can be used via Ankh.HTTP
.
Link to this section Summary
Functions
Accepts a client connection
Connects to an host
Reports a connection error
Sends a request
Sends a response
Handles transport messages
Link to this section Types
Link to this type
options()
@type options() :: keyword()
Protocol options
Link to this type
request_ref()
@type request_ref() :: reference()
Request reference
@type t() :: struct()
Ankh protocol
Link to this section Functions
Link to this function
accept(protocol, uri, transport, socket, options)
@spec accept( t(), URI.t(), Ankh.Transport.t(), Ankh.Transport.socket(), Ankh.Transport.options() ) :: {:ok, t()} | {:error, any()}
Accepts a client connection
Link to this function
connect(protocol, uri, transport, options)
@spec connect(t(), URI.t(), Ankh.Transport.t(), Ankh.Transport.options()) :: {:ok, t()} | {:error, any()}
Connects to an host
Link to this function
error(protocol)
Reports a connection error
Link to this function
request(protocol, request)
@spec request(t(), Ankh.HTTP.Request.t()) :: {:ok, t(), request_ref()} | {:error, any()}
Sends a request
Link to this function
respond(protocol, request_reference, response)
@spec respond(t(), request_ref(), Ankh.HTTP.Response.t()) :: {:ok, t()} | {:error, any()}
Sends a response
Link to this function
stream(protocol, messages)
@spec stream(t(), any()) :: {:ok, t(), [Ankh.HTTP.response()]} | {:error, any()}
Handles transport messages