View Source Mobius.Bundle (mobius v0.3.7)
Link to this section Summary
Types
Options to use when extracting
Meta information for a bundle
Options for creating a bundle
A bundle
The target is who the the bundle is created for
Link to this section Types
Specs
Options to use when extracting
:time_as- convert the system time into either DateTime or NaiveDateTime.:extract_dir- the directory to use for bundle extraction, this is cleaned up after extraction.
Converting time is useful because different time series databases expect different types of timestamps. If you're saving data into a time series database be sure to read the documentation to make sure you're providing the right information to your database.
Specs
meta() :: %{
target: target(),
version: non_neg_integer(),
number_of_records: non_neg_integer()
}
Meta information for a bundle
:target- the target name of the device or application using mobius:version- the bundle version used when creating the bundle:number_of_records- the number of records in the bundle
Specs
Options for creating a bundle
:out_dir- the output directory for the bundle, by default this is the/tmpdirectory:compressed- if the bundle should use compression:verbose- print extra information about each file added to the bundle:prefix- a prefix to the file name generated by saving the bundle. By default this is the current system time in the:nativetime unit.
Specs
A bundle
:meta- extra info about the containing data and other pieces of information that might be useful a consuming service:data- the data
Specs
target() :: binary()
The target is who the the bundle is created for
This can be Nerves device's serial number or the name of the application using Mobius. This is useful for external services to identify which entity is sending the bundle.
Link to this section Functions
Specs
extract(Path.t(), [extract_opt()]) :: {:ok, t()} | {:error, Mobius.Bundle.ExtractError.t()}
Specs
new(target(), [Mobius.record()]) :: t()
Make a new bundle
Specs
save(t(), [save_opt()]) :: {:ok, Path.t()} | {:error, Mobius.Bundle.SaveError.t()}
Save a bundle to disk
If saving the bundle works this will print the path to the created bundle. This is useful as often times you might want to do something with bundle shortly after its creation.