VerifiedPubSub.Transformers.ParseParams (VerifiedPubSub v0.1.0)

Copy Markdown View Source

Validates the segments of each topic, and finds the params in them.

So a manifest declares each param only once, in the segments.

Summary

Functions

Callback implementation for Spark.Dsl.Transformer.after?/1.

Callback implementation for Spark.Dsl.Transformer.before?/1.

Validates a list of segments, and returns the names of its params in order.

Functions

after?(_)

Callback implementation for Spark.Dsl.Transformer.after?/1.

after_compile?()

Callback implementation for Spark.Dsl.Transformer.after_compile?/0.

before?(_)

Callback implementation for Spark.Dsl.Transformer.before?/1.

parse(segments)

@spec parse([String.t() | atom()]) :: {:ok, [atom()]} | {:error, String.t()}

Validates a list of segments, and returns the names of its params in order.

iex> VerifiedPubSub.Transformers.ParseParams.parse(["owners", :owner_id, "pets"])
{:ok, [:owner_id]}