FerricStore.SDK.Native.Client (ferricstore_sdk v0.2.2)

Copy Markdown View Source

Minimal FerricStore native protocol client with topology-aware shard routing.

Summary

Types

seed()

@type seed() :: {binary(), non_neg_integer()} | map()

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

close(client)

@spec close(pid()) :: :ok

command_exec(client, command, args \\ [], opts \\ [])

@spec command_exec(pid(), binary(), list(), keyword()) ::
  {:ok, term()} | {:error, term()}

from_url(url, opts \\ [])

@spec from_url(
  binary(),
  keyword()
) :: GenServer.on_start()

get(client, key, opts \\ [])

@spec get(pid(), binary(), keyword()) :: {:ok, binary() | nil} | {:error, term()}

ping(client, message \\ "PONG", opts \\ [])

@spec ping(pid(), term(), keyword()) :: {:ok, term()} | {:error, term()}

refresh_topology(client)

@spec refresh_topology(pid()) :: :ok | {:error, term()}

request(client, opcode, payload \\ %{}, opts \\ [])

@spec request(pid(), non_neg_integer() | atom() | binary(), map(), keyword()) ::
  {:ok, term()} | {:error, term()}

request_by_items(client, opcode, items, key_fun, payload_builder, opts \\ [])

@spec request_by_items(
  pid(),
  non_neg_integer() | atom() | binary(),
  list(),
  (term() -> binary()),
  (list() -> map()),
  keyword()
) :: {:ok, [map()]} | {:error, term()}

request_by_key(client, opcode, key, payload, opts \\ [])

@spec request_by_key(
  pid(),
  non_neg_integer() | atom() | binary(),
  binary(),
  map(),
  keyword()
) ::
  {:ok, term()} | {:error, term()}

request_by_keys(client, opcode, keys, payload_builder, opts \\ [])

@spec request_by_keys(
  pid(),
  non_neg_integer() | atom() | binary(),
  [binary()],
  ([binary()] -> map()),
  keyword()
) :: {:ok, [map()]} | {:error, term()}

route(client, key)

@spec route(pid(), binary()) :: {:ok, map()} | {:error, term()}

set(client, key, value, opts \\ [])

@spec set(pid(), binary(), term(), keyword()) ::
  :ok | {:ok, term()} | {:error, term()}

start_link(opts)

@spec start_link(keyword()) :: GenServer.on_start()

topology(client)

@spec topology(pid()) :: FerricStore.SDK.Native.Topology.t()