Mediate.Access (mediate v0.1.0)

Copy Markdown View Source

The access event: one telemetry event for each mediated read of a protected schema. The seam publishes it after the read returns, at the one site every query function passes through. So it covers get, one, all, exists?, aggregate, stream, preload, and reload alike. Only a read that carried a decision publishes. An exempt read, a read through the owner-role repo, and a raw query publish nothing.

Events under "Access" has the payload. The one measurement is count. The library publishes the event and stores nothing.

Summary

Types

What the read answered with: rows of the schema, one value, or a stream not yet run.

Functions

The telemetry event an access publishes, which is what a consumer attaches to.

Publish one access: the read's result under the decision it ran under, at the moment given.

Types

shape()

@type shape() :: :rows | :value | :stream

What the read answered with: rows of the schema, one value, or a stream not yet run.

Functions

event()

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

The telemetry event an access publishes, which is what a consumer attaches to.

publish(repo, schema, call, result, decision, at)

@spec publish(
  module(),
  module(),
  {atom(), non_neg_integer()},
  term(),
  Mediate.Decision.t(),
  DateTime.t()
) :: :ok

Publish one access: the read's result under the decision it ran under, at the moment given.