View Source ConfluentSchema.Cache (confluent_schema v0.1.3)
Cache Confluent schemas on ETS table.
Link to this section Summary
Functions
Return the cached Confluent schema for a given subject.
Raise ArgumentError
if cache is not started.
Cache the Confluent schema for a given subject.
Raise ArgumentError
if cache is not started.
Starts cache for Confluent schemas.
Must be called before cache is used.
Raise ArgumentError
if called more than once.
Link to this section Functions
Return the cached Confluent schema for a given subject.
Raise ArgumentError
if cache is not started.
example
Example
iex> Cache.start()
iex> Cache.set("my-subject", %{"type" => "string"})
iex> Cache.get("my-subject")
{:ok, %{"type" => "string"}}
iex> Cache.start()
iex> Cache.get("my-subject")
{:error, :not_found}
Cache the Confluent schema for a given subject.
Raise ArgumentError
if cache is not started.
example
Example
iex> Cache.start()
iex> Cache.set("my-subject", %{"type" => "string"})
true
iex> assert_raise ArgumentError, fn -> Cache.set("my-subject", %{"type" => "string"}) end
Starts cache for Confluent schemas.
Must be called before cache is used.
Raise ArgumentError
if called more than once.
example
Example
iex> Cache.start()
:"Elixir.ConfluentSchema.Cache"
iex> Cache.start()
iex> assert_raise ArgumentError, fn -> Cache.start() end