marina_utils (marina v0.4.3)

View Source

Summary

Types

batch_type/0

-type batch_type() :: logged | unlogged | counter.

consistency_level/0

-type consistency_level() :: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10.

frame_flag/0

-type frame_flag() :: 0..1.

query_opts/0

-type query_opts() ::
          #{batch_type => batch_type(),
            consistency_level => consistency_level(),
            page_size => pos_integer(),
            paging_state => binary(),
            pid => pid(),
            routing_key => routing_key(),
            skip_metadata => boolean(),
            timeout => pos_integer(),
            values => values()}.

routing_key/0

-type routing_key() :: integer() | binary().

value/0

-type value() :: binary().

values/0

-type values() :: [value()].

Functions

authenticate(Socket)

-spec authenticate(inet:socket()) -> ok | {error, atom()}.

connect(Ip, Port)

-spec connect(inet:socket_address() | inet:hostname(), inet:port_number()) ->
                 {ok, inet:socket()} | {error, atom()}.

frame_flags()

-spec frame_flags() -> frame_flag().

pack(Iolist)

-spec pack(binary() | iolist()) -> {ok, binary()} | {error, term()}.

query(Socket, Query)

-spec query(inet:socket(), iodata()) -> {ok, term()} | {error, term()}.

query_opts(_, QueryOpts)

-spec query_opts(atom(), query_opts()) -> term().

server_to_pool(Node)

-spec server_to_pool(atom()) -> atom().

startup(Socket)

-spec startup(inet:socket()) -> {ok, binary() | undefined} | {error, atom()}.

sync_msg(Socket, Msg)

-spec sync_msg(inet:socket(), iodata()) -> {ok, term()} | {error, term()}.

timeout(Timeout, Timestamp)

-spec timeout(pos_integer(), erlang:timestamp()) -> integer().

unpack(_)

-spec unpack(binary()) -> {ok, binary()} | {error, term()}.

use_keyspace(Socket)

-spec use_keyspace(inet:socket()) -> ok | {error, atom()}.