reckon_db_sup (reckon_db v2.1.2)

View Source

Top-level supervisor for reckon-db

This supervisor manages all store instances configured in the application environment. Each store gets its own system supervisor subtree.

Summary

Functions

Start the top-level supervisor

Start a store dynamically

Stop a store dynamically

Get list of running stores

Types

integrity_config/0

-type integrity_config() :: disabled | #{enabled := true, key_source := integrity_key_source()}.

integrity_key_source/0

-type integrity_key_source() :: {env_var, EnvName :: binary()} | {sealed_file, Path :: file:filename()}.

store_config/0

-type store_config() ::
          #store_config{store_id :: atom(),
                        data_dir :: string(),
                        mode :: single | cluster,
                        timeout :: pos_integer(),
                        writer_pool_size :: pos_integer(),
                        reader_pool_size :: pos_integer(),
                        gateway_pool_size :: pos_integer(),
                        options :: map(),
                        integrity :: integrity_config()}.

Functions

start_link()

-spec start_link() -> {ok, pid()} | {error, term()}.

Start the top-level supervisor

start_store(StoreId)

-spec start_store(atom() | store_config()) -> {ok, pid()} | {error, term()}.

Start a store dynamically

stop_store(StoreId)

-spec stop_store(atom()) -> ok | {error, term()}.

Stop a store dynamically

which_stores()

-spec which_stores() -> [atom()].

Get list of running stores