Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

protocol v2 #16

Open
wants to merge 1 commit into
base: protocol_v2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@ xref:

test:
@./rebar skip_deps=true eunit

quick_test:
@./rebar skip_deps=true eunit suites=seestar_session_tests
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@ where CASSANDRA_DIR is the path to the compiled Cassandra directory.


<table width="100%" border="0" summary="list of modules">
<tr><td><a href="https://github.com/iamaleksey/seestar/blob/master/doc/seestar.md" class="module">seestar</a></td></tr>
<tr><td><a href="https://github.com/iamaleksey/seestar/blob/master/doc/seestar_cqltypes.md" class="module">seestar_cqltypes</a></td></tr>
<tr><td><a href="https://github.com/iamaleksey/seestar/blob/master/doc/seestar_error.md" class="module">seestar_error</a></td></tr>
<tr><td><a href="https://github.com/iamaleksey/seestar/blob/master/doc/seestar_event.md" class="module">seestar_event</a></td></tr>
<tr><td><a href="https://github.com/iamaleksey/seestar/blob/master/doc/seestar_result.md" class="module">seestar_result</a></td></tr>
<tr><td><a href="https://github.com/iamaleksey/seestar/blob/master/doc/seestar_session.md" class="module">seestar_session</a></td></tr></table>
<tr><td><a href="https://github.com/iamaleksey/seestar/blob/HEAD/doc/seestar.md" class="module">seestar</a></td></tr>
<tr><td><a href="https://github.com/iamaleksey/seestar/blob/HEAD/doc/seestar_batch.md" class="module">seestar_batch</a></td></tr>
<tr><td><a href="https://github.com/iamaleksey/seestar/blob/HEAD/doc/seestar_cqltypes.md" class="module">seestar_cqltypes</a></td></tr>
<tr><td><a href="https://github.com/iamaleksey/seestar/blob/HEAD/doc/seestar_error.md" class="module">seestar_error</a></td></tr>
<tr><td><a href="https://github.com/iamaleksey/seestar/blob/HEAD/doc/seestar_event.md" class="module">seestar_event</a></td></tr>
<tr><td><a href="https://github.com/iamaleksey/seestar/blob/HEAD/doc/seestar_password_auth.md" class="module">seestar_password_auth</a></td></tr>
<tr><td><a href="https://github.com/iamaleksey/seestar/blob/HEAD/doc/seestar_session.md" class="module">seestar_session</a></td></tr></table>

3 changes: 2 additions & 1 deletion doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ where CASSANDRA_DIR is the path to the compiled Cassandra directory.

<table width="100%" border="0" summary="list of modules">
<tr><td><a href="seestar.md" class="module">seestar</a></td></tr>
<tr><td><a href="seestar_batch.md" class="module">seestar_batch</a></td></tr>
<tr><td><a href="seestar_cqltypes.md" class="module">seestar_cqltypes</a></td></tr>
<tr><td><a href="seestar_error.md" class="module">seestar_error</a></td></tr>
<tr><td><a href="seestar_event.md" class="module">seestar_event</a></td></tr>
<tr><td><a href="seestar_result.md" class="module">seestar_result</a></td></tr>
<tr><td><a href="seestar_password_auth.md" class="module">seestar_password_auth</a></td></tr>
<tr><td><a href="seestar_session.md" class="module">seestar_session</a></td></tr></table>

90 changes: 90 additions & 0 deletions doc/seestar_batch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@


# Module seestar_batch #
* [Data Types](#types)
* [Function Index](#index)
* [Function Details](#functions)



<a name="types"></a>

## Data Types ##




### <a name="type-batch_query">batch_query()</a> ###



<pre><code>
batch_query() = #batch_query{}
</code></pre>





### <a name="type-batch_request">batch_request()</a> ###



<pre><code>
batch_request() = #batch{}
</code></pre>


<a name="index"></a>

## Function Index ##


<table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#batch_request-3">batch_request/3</a></td><td>Return a batch request that can be sent to cassandra
Use <a href="seestar_session.md"><code>seestar_session</code></a> module to send the request.</td></tr><tr><td valign="top"><a href="#normal_query-2">normal_query/2</a></td><td>Return a normal query that can be added to batch request.</td></tr><tr><td valign="top"><a href="#prepared_query-2">prepared_query/2</a></td><td>Return a prepared query that can be added to batch request.</td></tr></table>


<a name="functions"></a>

## Function Details ##

<a name="batch_request-3"></a>

### batch_request/3 ###


<pre><code>
batch_request(Type::logged | unlogged | counter, Consistency::one | atom(), Queries::[<a href="#type-batch_query">batch_query()</a>]) -&gt; <a href="#type-batch_request">batch_request()</a>
</code></pre>
<br />

Return a batch request that can be sent to cassandra
Use [`seestar_session`](seestar_session.md) module to send the request

__See also:__ [seestar_session:batch/2](seestar_session.md#batch-2), [seestar_session:batch_async/2](seestar_session.md#batch_async-2).
<a name="normal_query-2"></a>

### normal_query/2 ###


<pre><code>
normal_query(Query::binary(), Values::[<a href="seestar_cqltypes.md#type-value">seestar_cqltypes:value()</a>]) -&gt; <a href="#type-batch_query">batch_query()</a>
</code></pre>
<br />

Return a normal query that can be added to batch request

__See also:__ [batch_request/3](#batch_request-3).
<a name="prepared_query-2"></a>

### prepared_query/2 ###


<pre><code>
prepared_query(Prepared_query::<a href="seestar_result.md#type-prepared_query">seestar_result:prepared_query()</a>, Values::[<a href="seestar_cqltypes.md#type-value">seestar_cqltypes:value()</a>]) -&gt; <a href="#type-batch_query">batch_query()</a>
</code></pre>
<br />

Return a prepared query that can be added to batch request

__See also:__ [batch_request/3](#batch_request-3).
2 changes: 1 addition & 1 deletion doc/seestar_cqltypes.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ type() = <a href="#type-native">native()</a> | {list | set, <a href="#type-nativ


<pre><code>
value() = null | integer() | binary() | boolean() | float() | <a href="inet.md#type-ip_address">inet:ip_address()</a> | <a href="#type-decimal">decimal()</a> | list() | dict() | set()
value() = null | integer() | binary() | boolean() | float() | <a href="inet.md#type-ip_address">inet:ip_address()</a> | <a href="#type-decimal">decimal()</a> | list() | <a href="#type-dict_t">dict_t()</a> | <a href="#type-set_t">set_t()</a>
</code></pre>


44 changes: 11 additions & 33 deletions doc/seestar_error.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ write_type() = simple | batch | unlogged_batch | counter | batch_log
<pre><code>
alive(Error::<a href="#type-error">error()</a>) -&gt; integer()
</code></pre>

<br></br>

<br />


<a name="code-1"></a>
Expand All @@ -64,9 +62,7 @@ alive(Error::<a href="#type-error">error()</a>) -&gt; integer()
<pre><code>
code(Error::<a href="#type-error">error()</a>) -&gt; integer()
</code></pre>

<br></br>

<br />


<a name="consistency-1"></a>
Expand All @@ -77,9 +73,7 @@ code(Error::<a href="#type-error">error()</a>) -&gt; integer()
<pre><code>
consistency(Error::<a href="#type-error">error()</a>) -&gt; <a href="seestar.md#type-consistency">seestar:consistency()</a>
</code></pre>

<br></br>

<br />


<a name="data_present-1"></a>
Expand All @@ -90,9 +84,7 @@ consistency(Error::<a href="#type-error">error()</a>) -&gt; <a href="seestar.md#
<pre><code>
data_present(Error::<a href="#type-error">error()</a>) -&gt; boolean()
</code></pre>

<br></br>

<br />


<a name="keyspace-1"></a>
Expand All @@ -103,9 +95,7 @@ data_present(Error::<a href="#type-error">error()</a>) -&gt; boolean()
<pre><code>
keyspace(Error::<a href="#type-error">error()</a>) -&gt; binary()
</code></pre>

<br></br>

<br />


<a name="message-1"></a>
Expand All @@ -116,9 +106,7 @@ keyspace(Error::<a href="#type-error">error()</a>) -&gt; binary()
<pre><code>
message(Error::<a href="#type-error">error()</a>) -&gt; binary()
</code></pre>

<br></br>

<br />


<a name="query_id-1"></a>
Expand All @@ -129,9 +117,7 @@ message(Error::<a href="#type-error">error()</a>) -&gt; binary()
<pre><code>
query_id(Error::<a href="#type-error">error()</a>) -&gt; binary()
</code></pre>

<br></br>

<br />


<a name="received-1"></a>
Expand All @@ -142,9 +128,7 @@ query_id(Error::<a href="#type-error">error()</a>) -&gt; binary()
<pre><code>
received(Error::<a href="#type-error">error()</a>) -&gt; integer()
</code></pre>

<br></br>

<br />


<a name="required-1"></a>
Expand All @@ -155,9 +139,7 @@ received(Error::<a href="#type-error">error()</a>) -&gt; integer()
<pre><code>
required(Error::<a href="#type-error">error()</a>) -&gt; integer()
</code></pre>

<br></br>

<br />


<a name="table-1"></a>
Expand All @@ -168,9 +150,7 @@ required(Error::<a href="#type-error">error()</a>) -&gt; integer()
<pre><code>
table(Error::<a href="#type-error">error()</a>) -&gt; binary() | undefined
</code></pre>

<br></br>

<br />


<a name="write_type-1"></a>
Expand All @@ -181,8 +161,6 @@ table(Error::<a href="#type-error">error()</a>) -&gt; binary() | undefined
<pre><code>
write_type(Error::<a href="#type-error">error()</a>) -&gt; <a href="#type-write_type">write_type()</a>
</code></pre>

<br></br>

<br />


24 changes: 6 additions & 18 deletions doc/seestar_event.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,7 @@ type() = topology_change | status_change | schema_change
<pre><code>
change(Event::<a href="#type-event">event()</a>) -&gt; <a href="#type-topology_change">topology_change()</a> | <a href="#type-status_change">status_change()</a> | <a href="#type-schema_change">schema_change()</a>
</code></pre>

<br></br>

<br />


<a name="ip-1"></a>
Expand All @@ -136,9 +134,7 @@ change(Event::<a href="#type-event">event()</a>) -&gt; <a href="#type-topology_c
<pre><code>
ip(Event::<a href="#type-topology_change_event">topology_change_event()</a> | <a href="#type-status_change_event">status_change_event()</a>) -&gt; <a href="inet.md#type-ip_address">inet:ip_address()</a>
</code></pre>

<br></br>

<br />


<a name="keyspace-1"></a>
Expand All @@ -149,9 +145,7 @@ ip(Event::<a href="#type-topology_change_event">topology_change_event()</a> | <a
<pre><code>
keyspace(Event::<a href="#type-schema_change_event">schema_change_event()</a>) -&gt; binary()
</code></pre>

<br></br>

<br />


<a name="port-1"></a>
Expand All @@ -162,9 +156,7 @@ keyspace(Event::<a href="#type-schema_change_event">schema_change_event()</a>) -
<pre><code>
port(Event::<a href="#type-topology_change_event">topology_change_event()</a> | <a href="#type-status_change_event">status_change_event()</a>) -&gt; <a href="inet.md#type-port_number">inet:port_number()</a>
</code></pre>

<br></br>

<br />


<a name="table-1"></a>
Expand All @@ -175,9 +167,7 @@ port(Event::<a href="#type-topology_change_event">topology_change_event()</a> |
<pre><code>
table(Event::<a href="#type-schema_change_event">schema_change_event()</a>) -&gt; binary() | undefined
</code></pre>

<br></br>

<br />


<a name="type-1"></a>
Expand All @@ -188,8 +178,6 @@ table(Event::<a href="#type-schema_change_event">schema_change_event()</a>) -&gt
<pre><code>
type(Event::<a href="#type-event">event()</a>) -&gt; <a href="#type-type">type()</a>
</code></pre>

<br></br>

<br />


36 changes: 36 additions & 0 deletions doc/seestar_password_auth.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@


# Module seestar_password_auth #
* [Function Index](#index)
* [Function Details](#functions)


<a name="index"></a>

## Function Index ##


<table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#perform_auth-2">perform_auth/2</a></td><td>
Method that needs to be implemented by any password authentication module
The sendFun accepts a #auth_response{} and returns #error{} | #auth_challenge{} | #auth_success{}
{Username, Password} is the data passed to the seestar_session module.</td></tr></table>


<a name="functions"></a>

## Function Details ##

<a name="perform_auth-2"></a>

### perform_auth/2 ###


<pre><code>
perform_auth(SendFun::function(), X2::{Username::binary(), Password::binary()}) -&gt; Success::boolean()
</code></pre>
<br />


Method that needs to be implemented by any password authentication module
The sendFun accepts a #auth_response{} and returns #error{} | #auth_challenge{} | #auth_success{}
{Username, Password} is the data passed to the seestar_session module
Loading