View Source ExWal.Store behaviour (ex_wal v0.1.3)

storage behavior

Summary

Types

@type handler() :: pid() | :file.fd()
@type path() :: String.t()
@type permision() :: non_neg_integer()
@type t() :: struct()

Callbacks

Link to this callback

append(t, handler, binary)

View Source
@callback append(t(), handler(), binary()) :: :ok | {:error, term()}
@callback close(t(), handler()) :: :ok | {:error, term()}
Link to this callback

mkdir(t, path, permision)

View Source
@callback mkdir(t(), path(), permision()) :: :ok
@callback new(opts :: keyword()) :: t()
Link to this callback

open(t, path, permision)

View Source
@callback open(t(), path(), permision()) :: {:ok, handler()} | {:error, term()}
@callback read_all(t(), path()) :: {:ok, binary()} | {:error, term()}
@callback rename(t(), path(), path()) :: :ok | {:error, term()}
@callback rm(t(), path()) :: :ok | {:error, term()}
@callback sync(t(), handler()) :: :ok | {:error, term()}
Link to this callback

write_all(t, path, binary)

View Source
@callback write_all(t(), path(), binary()) :: :ok | {:error, term()}

Functions

Link to this function

append(store, handler, data)

View Source
@spec append(t(), handler(), binary()) :: :ok | {:error, term()}
@spec close(t(), handler()) :: :ok | {:error, term()}
Link to this function

mkdir(store, path, permission)

View Source
@spec mkdir(t(), path(), permision()) :: :ok
Link to this function

open(store, path, permission)

View Source
@spec open(t(), path(), permision()) :: {:ok, handler()} | {:error, term()}
@spec read_all(t(), path()) :: {:ok, binary()} | {:error, term()}
Link to this function

rename(store, source, destionation)

View Source
@spec rename(t(), path(), path()) :: :ok | {:error, term()}
@spec rm(t(), path()) :: :ok | {:error, term()}
@spec sync(t(), handler()) :: :ok | {:error, term()}
Link to this function

write_all(store, path, data)

View Source
@spec write_all(t(), path(), binary()) :: :ok | {:error, term()}