gremlex v0.3.2 Gremlex.Client View Source

Gremlin Websocket Client

Link to this section Summary

Functions

Accepts a graph which it converts into a query and queries the database

Link to this section Types

Link to this type response() View Source
response() ::
  {:ok, list()}
  | {:error, :unauthorized, String.t()}
  | {:error, :malformed_request, String.t()}
  | {:error, :invalid_request_arguments, String.t()}
  | {:error, :server_error, String.t()}
  | {:error, :script_evaluation_error, String.t()}
  | {:error, :server_timeout, String.t()}
  | {:error, :server_serialization_error, String.t()}
Link to this type state() View Source
state() :: %{socket: Socket.Web.t()}

Link to this section Functions

Link to this function handle_call(arg, from, state) View Source
handle_call({:query, String.t(), number() | :infinity}, pid(), state()) ::
  {:reply, response(), state()}
Link to this function query(query, timeout \\ 5000) View Source
query(Gremlex.Graph.t() | String.t(), number() | :infinity) :: Response

Accepts a graph which it converts into a query and queries the database.

Params:

  • query - A Gremlex.Graph.t or raw String query
  • timeout (Default: 5000ms) - Timeout in milliseconds to pass to GenServer and Task.await call
Link to this function start_link(arg) View Source
start_link({String.t(), number(), String.t(), boolean()}) :: pid()