Fact.BootstrapFile (Fact v0.3.1)
View SourceThis module encapsulates the adapters used for working with the bootstrap record file.
Summary
Types
A small subset of a Fact.Context.t/0 containing the following keys with .
Functions
Reads the bootstrap file.
Writes a minimal amount of the Fact.Context structure to the bootstrap file.
Types
@type bootstrap_record() :: map()
A small subset of a Fact.Context.t/0 containing the following keys with .
- record_id -
Fact.record_id/0 - record_file_decoder -
Fact.Genesis.Event.DatabaseCreated.V1.component_config/0 - record_file_reader -
Fact.Genesis.Event.DatabaseCreated.V1.component_config/0 - event_schema -
Fact.Genesis.Event.DatabaseCreated.V1.component_config/0 - storage -
Fact.Genesis.Event.DatabaseCreated.V1.component_config/0
Functions
@spec read(Path.t()) :: {:ok, bootstrap_record()}
Reads the bootstrap file.
@spec write(Path.t(), genesis_record :: Fact.record()) :: :ok | {:error, term()}
Writes a minimal amount of the Fact.Context structure to the bootstrap file.
It writes just enough configuration, so that the genesis record (Fact.Genesis.Event.DatabaseCreated.V1)
can be read and a full Fact.Context can be loaded.