buoy_client (buoy v0.2.6)

View Source

Summary

Types

buoy_resp/0

-type buoy_resp() ::
          #buoy_resp{state :: body | done,
                     body :: undefined | binary(),
                     content_length :: undefined | non_neg_integer() | chunked,
                     headers :: undefined | [binary()],
                     reason :: undefined | binary(),
                     status_code :: undefined | 100..505}.

buoy_url/0

-type buoy_url() ::
          #buoy_url{host :: host(),
                    hostname :: hostname(),
                    path :: path(),
                    port :: inet:port_number(),
                    protocol :: protocol_http()}.

host/0

-type host() :: binary().

hostname/0

-type hostname() :: binary().

path/0

-type path() :: binary().

protocol_http/0

-type protocol_http() :: http | https.

state/0

-type state() ::
          #state{bin_patterns :: tuple(),
                 buffer :: binary(),
                 queue :: queue:queue(),
                 request_id :: non_neg_integer(),
                 response :: undefined | buoy_resp()}.

Functions

handle_data(Data, State)

-spec handle_data(binary(), state()) ->
                     {ok, [{pos_integer(), term()}], state()} | {error, atom(), state()}.

handle_request(_, State)

-spec handle_request(term(), state()) -> {ok, non_neg_integer(), iodata(), state()}.

init(Opts)

-spec init(undefined) -> {ok, state()}.

setup(Socket, State)

-spec setup(inet:socket(), state()) -> {ok, state()}.

terminate(State)

-spec terminate(state()) -> ok.