View Source backwater_request (backwater v3.6.0)

Summary

Types

-type conn_params() ::
    #{transport := transport(), host := nonempty_string(), port := inet:port_number()}.
-type endpoint() :: {location(), secret()}.
-type http_params() ::
    #{method := nonempty_binary(),
      path := nonempty_binary(),
      headers := nonempty_headers(),
      body := binary()}.
-type location() ::
    nonempty_binary() |
    nonempty_string() |
    {nonempty_string(), inet:port_number()} |
    inet:ip_address() |
    {inet:ip_address(), inet:port_number()}.
-type nonempty_headers() :: [{nonempty_binary(), binary()}, ...].
-type options() :: #{compression_threshold => non_neg_integer()}.
-type secret() :: binary().
-type state() :: #{signed_request_msg := backwater_signatures:signed_message()}.
-type t() ::
    #{conn_params := conn_params(), http_params := http_params(), full_url := nonempty_binary()}.
-type transport() :: hackney_tcp | hackney_ssl.

Functions

Link to this function

encode(Endpoint, Module, Function, Args)

View Source
-spec encode(Endpoint, Module, Function, Args) -> {Request, RequestState}
          when
              Endpoint :: endpoint(),
              Module :: module(),
              Function :: atom(),
              Args :: [term()],
              Request :: t(),
              RequestState :: state().
Link to this function

encode(Endpoint, Module, Function, Args, Options)

View Source
-spec encode(Endpoint, Module, Function, Args, Options) -> {Request, RequestState}
          when
              Endpoint :: endpoint(),
              Module :: module(),
              Function :: atom(),
              Args :: [term()],
              Options :: options(),
              Request :: t(),
              RequestState :: state().