FerricStore.Flow.MetadataExtension behaviour (ferricstore v0.11.1)

Copy Markdown View Source

Frozen edition boundary for hidden Flow system metadata.

Providers resolve trusted ingress authority once. Core validates and seals their output before it enters a replicated command or physical query plan.

Summary

Types

query_scope()

@type query_scope() ::
  :unscoped
  | {:required, [{non_neg_integer(), :eq, term()}]}
  | {:required_union, [[{non_neg_integer(), :eq, term()}]]}

Callbacks

bind_query(atom, map, t)

@callback bind_query(atom(), map(), FerricStore.Flow.MetadataExtension.Snapshot.t()) ::
  {:ok, query_scope()} | {:error, term()}

bind_write(atom, map, t)

@callback bind_write(atom(), map(), FerricStore.Flow.MetadataExtension.Snapshot.t()) ::
  {:ok, map()} | {:error, term()}

configure(keyword)

@callback configure(keyword()) ::
  {:ok,
   %{mode: :dedicated | :shared, generation: non_neg_integer(), fields: [map()]}}
  | {:error, term()}

Functions

bind_query(ctx, source)

@spec bind_query(map(), atom()) :: {:ok, query_scope()} | {:error, atom()}

bind_query(snapshot, source, trusted_context)

@spec bind_query(FerricStore.Flow.MetadataExtension.Snapshot.t(), atom(), map()) ::
  {:ok, query_scope()} | {:error, atom()}

bind_write(ctx, operation)

@spec bind_write(map(), atom()) ::
  {:ok, Ferricstore.Flow.SystemMetadata.t()} | {:error, atom()}

bind_write(snapshot, operation, trusted_context)

@spec bind_write(FerricStore.Flow.MetadataExtension.Snapshot.t(), atom(), map()) ::
  {:ok, Ferricstore.Flow.SystemMetadata.t()} | {:error, atom()}

configure(implementation, opts)

@spec configure(
  module(),
  keyword()
) :: {:ok, FerricStore.Flow.MetadataExtension.Snapshot.t()} | {:error, atom()}

configured_implementation(opts)

@spec configured_implementation(keyword()) :: module()

snapshot(snapshot)

@spec snapshot(term()) ::
  {:ok, FerricStore.Flow.MetadataExtension.Snapshot.t()}
  | {:error, :flow_metadata_extension_unavailable}

validate_configuration(arg1)

@spec validate_configuration(term()) ::
  {:ok, map()} | {:error, :invalid_flow_metadata_schema}

validate_implementation!(implementation)

@spec validate_implementation!(term()) :: module()