AuroraMeter.Config (Aurora Meter v0.1.0)

View Source

Reads and validates Aurora Meter configuration from the :aurora_meter application environment.

Configuration is validated once at boot by validate!/0 (called from AuroraMeter.start_link/1), which fails fast on a missing required key or a wrong type. Typed accessors below return the effective value, applying defaults for optional keys.

Summary

Functions

Milliseconds between live PubSub broadcasts of touched counters.

The plan id used for tenants with no subscription.

Features that also write a durable event row on every track.

Milliseconds between durable flushes of dirty counters to the database.

The configured period source.

The configured plans module.

The configured billing provider.

The configured host Phoenix.PubSub server name.

The configured host Ecto repo.

The configured storage adapter.

The configured tenant-resolution module.

Validates the current :aurora_meter configuration, raising on any problem.

Functions

broadcast_interval()

@spec broadcast_interval() :: pos_integer()

Milliseconds between live PubSub broadcasts of touched counters.

default_plan()

@spec default_plan() :: atom()

The plan id used for tenants with no subscription.

durable_features()

@spec durable_features() :: [atom()]

Features that also write a durable event row on every track.

flush_interval()

@spec flush_interval() :: pos_integer()

Milliseconds between durable flushes of dirty counters to the database.

period_source()

@spec period_source() :: module()

The configured period source.

plans()

@spec plans() :: module()

The configured plans module.

provider()

@spec provider() :: module()

The configured billing provider.

pubsub()

@spec pubsub() :: atom()

The configured host Phoenix.PubSub server name.

repo()

@spec repo() :: module()

The configured host Ecto repo.

storage()

@spec storage() :: module()

The configured storage adapter.

tenant()

@spec tenant() :: module()

The configured tenant-resolution module.

validate!()

@spec validate!() :: keyword()

Validates the current :aurora_meter configuration, raising on any problem.

Returns the validated options (with defaults applied) on success.

Examples

iex> is_list(AuroraMeter.Config.validate!())
true