Instream v0.18.0 Instream.Response View Source

Response handling module.

Link to this section Summary

Functions

Maybe parses a response based on the requested result type

Parses the response of a ping query

Parses the response of a status query

Parses the response of a version query

Link to this section Types

Link to this type t() View Source
t() ::
  {:error, term()}
  | {status :: pos_integer(), headers :: list(), body :: String.t()}

Link to this section Functions

Link to this function maybe_parse(error, opts) View Source
maybe_parse(t(), Keyword.t()) :: any()

Maybe parses a response based on the requested result type.

Link to this function parse_ping(arg1) View Source
parse_ping(any()) :: :pong | :error

Parses the response of a ping query.

Link to this function parse_status(arg1) View Source
parse_status(any()) :: :ok | :error

Parses the response of a status query.

Link to this function parse_version(arg1) View Source
parse_version(any()) :: String.t() | :error

Parses the response of a version query.

Returns “unknown” if the response did not contain a parseable header.