View Source ElixirAvro.AvroType.Primitive behaviour (elixir_avro v0.1.0)

Summary

Functions

Callback implementation for ElixirAvro.AvroType.from_erl/1.

Returns the logical type or nil if the primitive type isn't a logical type.

Validate the given value against the provided Avro type.

Types

@type t() :: %ElixirAvro.AvroType.Primitive{
  custom_props: [ElixirAvro.AvroType.CustomProp.t()],
  name: String.t()
}

Callbacks

@callback from_erl(:avro.avro_type() | :avro.record_field()) :: t()

Functions

Callback implementation for ElixirAvro.AvroType.from_erl/1.

Link to this function

get_logical_type(primitive)

View Source
@spec get_logical_type(t()) :: String.t() | nil

Returns the logical type or nil if the primitive type isn't a logical type.

@spec validate(any(), String.t()) :: {:ok, any()} | {:error, String.t()}

Validate the given value against the provided Avro type.

Examples

NOTE: put here all the examples.