zf

zenflows testing
git clone https://s.sonu.ch/~srfsh/zf.git
Log | Files | Refs | Submodules | README | LICENSE

types.ex (2101B)


      1 defmodule Mint.Types do
      2   @moduledoc """
      3   HTTP-related types.
      4   """
      5 
      6   @typedoc """
      7   A hostname, IP address, Unix domain socket path, `:loopback`, or any
      8   other term representing an internet address.
      9   """
     10   @type address() :: :inet.socket_address() | String.t()
     11 
     12   @typedoc """
     13   A request reference that uniquely identifies a request.
     14 
     15   Responses for a request are always tagged with a request reference so that you
     16   can connect each response to the right request. Also see `Mint.HTTP.request/5`.
     17   """
     18   @type request_ref() :: reference()
     19 
     20   @typedoc """
     21   An HTTP/2-specific response to a request.
     22 
     23   This type of response is only returned on HTTP/2 connections. See `t:response/0` for
     24   more response types.
     25   """
     26   @type http2_response() ::
     27           {:pong, request_ref()}
     28           | {:push_promise, request_ref(), promised_request_ref :: request_ref(), headers()}
     29 
     30   @typedoc """
     31   A response to a request.
     32 
     33   Terms of this type are returned as responses to requests. See `Mint.HTTP.stream/2`
     34   for more information.
     35   """
     36   @type response() ::
     37           {:status, request_ref(), status()}
     38           | {:headers, request_ref(), headers()}
     39           | {:data, request_ref(), body_chunk :: binary()}
     40           | {:done, request_ref()}
     41           | {:error, request_ref(), reason :: term()}
     42           | http2_response()
     43 
     44   @typedoc """
     45   An HTTP status code.
     46 
     47   The type for an HTTP is a generic non-negative integer since we don't formally check that
     48   the response code is in the "common" range (`200..599`).
     49   """
     50   @type status() :: non_neg_integer()
     51 
     52   @typedoc """
     53   HTTP headers.
     54 
     55   Headers are sent and received as lists of two-element tuples containing two strings,
     56   the header name and header value.
     57   """
     58   @type headers() :: [{header_name :: String.t(), header_value :: String.t()}]
     59 
     60   @typedoc """
     61   The scheme to use when connecting to an HTTP server.
     62   """
     63   @type scheme() :: :http | :https
     64 
     65   @typedoc """
     66   An error reason.
     67   """
     68   @type error() :: Mint.TransportError.t() | Mint.HTTPError.t()
     69 
     70   @typedoc """
     71   The connection socket.
     72   """
     73   @type socket() :: term()
     74 end