Avrora.Schema.Name (avrora v0.18.1) View Source

Struct for versioned schema names like io.confluent.Payment:42.

Link to this section Summary

Functions

Parse schema name with optional version, returning struct.

Link to this section Types

Specs

t() :: %Avrora.Schema.Name{
  name: String.t(),
  origin: String.t(),
  version: nil | integer()
}

Link to this section Functions

Specs

parse(String.t()) :: {:ok, t()} | {:error, term()}

Parse schema name with optional version, returning struct.

Examples

iex> Avrora.Schema.Name.parse("Payment")
{:ok, %Avrora.Schema.Name{origin: "Payment", name: "Payment", version: nil}}
iex> Avrora.Schema.Name.parse("io.confluent.Payment:42")
{:ok, %Avrora.Schema.Name{origin: "io.confluent.Payment:42", name: "io.confluent.Payment", version: 42}}