API for working with the event log
Summary
Functions
Clear the event log
Turn a list of Events into a binary
List the events in the event log
Parse the Mobius binary formatted event log
Save the current state of the event log to disk
Return the event log in the Mobius binary format
Types
@type opt() :: {:from, integer()} | {:to, integer()} | {:instance, Mobius.instance()} | {:group, atom()}
Options to query the event log
:from- the unix timestamp (in seconds) to start listing events from:to- the unix timestamp (in seconds) to list events until:instance- the Mobius instance to query (defaults to:mobius):group- only list events that belong to this event group
@type serialize_opt() :: {:compression_level, 0..9}
Options for serializing the event log
:compression_level- the zlib level (0..9) used to compress the payload, defaults to9.0disables compression.
Functions
@spec clear([opt()]) :: :ok
Clear the event log
Empties the in-memory event log and removes the persisted event log file for the instance.
@spec events_to_binary([Mobius.Event.t()], [serialize_opt()]) :: binary()
Turn a list of Events into a binary
@spec list([opt()]) :: [Mobius.Event.t()]
List the events in the event log
@spec parse(binary()) :: {:ok, [Mobius.Event.t()]} | {:error, atom()}
Parse the Mobius binary formatted event log
Save the current state of the event log to disk
The configured compression level for the instance is applied by the events server when it writes the file.
@spec to_binary([opt() | serialize_opt()]) :: binary()
Return the event log in the Mobius binary format