View Source QuaggaDef (QuaggaDef v0.2.0)

Helper functions related to participating in the Quagga bamboo clump

By codifying conventions used therein, it is hope that it will be easier to maintain client-facing applications.

The Quagga clump uses a one byte facet_id to permit log-type consolidation for a logging identity. This is represented in the high 8-bits of the log_id

The lower 56-bits represent the base_log_id. Such conventions as exist for base_log_id contents are exposed in the log_defs

Link to this section Summary

Types

A 56-bit integer representing base_log in a log_id

An 8-bit integer representing the facet of an identity in a log_id

A map representing the Quagga conventions for log entry contents

A 64-bit integer representing a complete log_id

Functions

The base_log_id for a provided atomic name or integer log_id

Computes the correct log_id given a base_log_id or atomic name and a facet_id

The log definition map for a given integer log_id

A map of all presently defined log types

Unpack a given integer log_id into a tuple with {base_log_id, facet_id}

A log_id list for a provided atomic encoding across every facet_id

A log_id list for a provided atomic name Includes the computed values for each possible facet_id

Link to this section Types

@type base_log_id() :: integer()

A 56-bit integer representing base_log in a log_id

@type facet_id() :: integer()

An 8-bit integer representing the facet of an identity in a log_id

@type log_def() :: map()

A map representing the Quagga conventions for log entry contents

@type log_id() :: integer()

A 64-bit integer representing a complete log_id

Link to this section Functions

@spec base_log(atom() | log_id()) :: base_log_id() | :error

The base_log_id for a provided atomic name or integer log_id

Link to this function

facet_log(name, facet_id)

View Source
@spec facet_log(base_log_id() | atom(), facet_id()) :: log_id() | :error

Computes the correct log_id given a base_log_id or atomic name and a facet_id

@spec log_def(log_id()) :: log_def() | :error

The log definition map for a given integer log_id

@spec log_defs() :: %{required(base_log_id()) => log_def()}

A map of all presently defined log types

@spec log_id_unpack(log_id()) :: {base_log_id(), facet_id()} | :error

Unpack a given integer log_id into a tuple with {base_log_id, facet_id}

@spec logs_for_encoding(atom()) :: [log_id()]

A log_id list for a provided atomic encoding across every facet_id

@spec logs_for_name(atom()) :: [log_id()]

A log_id list for a provided atomic name Includes the computed values for each possible facet_id