anchor_client (anchor v0.3.6)

View Source

Summary

Types

error/0

-type error() :: {error, atom()}.

option/0

-type option() :: {async, pid()}.

options/0

-type options() :: [option()].

response/0

-type response() ::
          #response{op_code :: non_neg_integer() | undefined,
                    key_length :: non_neg_integer() | undefined,
                    extras_length :: non_neg_integer() | undefined,
                    data_type :: non_neg_integer() | undefined,
                    status :: non_neg_integer() | undefined,
                    body_length :: non_neg_integer() | undefined,
                    opaque :: non_neg_integer() | undefined,
                    cas :: non_neg_integer() | undefined,
                    extras :: binary() | undefined,
                    key :: binary() | undefined,
                    value :: binary() | undefined}.

state/0

-type state() :: #state{buffer :: binary(), requests :: non_neg_integer()}.

Functions

handle_data(Data, State)

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

handle_request(Request, State)

-spec handle_request(term(), state()) -> {ok, pos_integer(), binary(), state()}.

init(Opts)

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

setup(Socket, State)

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

terminate(State)

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