View Source Avrora.Storage.Registry (avrora v0.28.0)
Avora.Storage
behavior implementation which uses Confluent Schema
Registry.
This only implements the minimum client functionality needed to talk with the registry. Inspired by Schemex.
Summary
Functions
Get schema by integer ID or by the subject name.
Register new version of schema under subject name.
Functions
Get schema by integer ID or by the subject name.
If subject name was used by default the latest version will be used
unless it explicitly given (e.g io.confluent.Payment:1
).
Examples
...> {:ok, schema} = Avrora.Storage.Registry.get(1)
...> schema.full_name
"io.confluent.Payment"
...> {:ok, schema} = Avrora.Storage.Registry.get("io.confluent.Payment")
...> schema.full_name
"io.confluent.Payment"
Register new version of schema under subject name.
Examples
...> schema = ~s({"fields":[{"name":"id","type":"string"},{"name":"amount","type":"double"}],"name":"Payment","namespace":"io.confluent","type":"record"})
...> {:ok, schema} = Avrora.Storage.Registry.put("io.confluent.examples.Payment", schema)
...> schema.full_name
"io.confluent.Payment"