Module avro_array

Authors: Ilya Staheev (ilya.staheev@klarna.com).

Data Types

array_type()

array_type() = #avro_array_type{type = avro:type_or_name(), custom = [avro:custom_prop()]}

avro_type()

avro_type() = primitive_type() | array_type() | enum_type() | fixed_type() | map_type() | record_type() | union_type()

avro_value()

avro_value() = avro:canonicalized_value() | #avro_value{type = avro:type_or_name(), data = avro:avro_value()} | [#avro_value{type = avro:type_or_name(), data = avro:avro_value()}] | [{avro:name(), #avro_value{type = avro:type_or_name(), data = avro:avro_value()}}] | avro_map:data() | {json, binary()} | {binary, binary()}

custom_prop()

custom_prop() = {custom_prop_name(), custom_prop_value()}

custom_prop_name()

custom_prop_name() = binary()

custom_prop_value()

custom_prop_value() = jsone:json_value()

enum_type()

enum_type() = #avro_enum_type{name = avro:name(), namespace = avro:namespace(), aliases = [avro:name()], doc = avro:typedoc(), symbols = [avro:enum_symbol()], fullname = avro:fullname(), custom = [avro:custom_prop()]}

fixed_type()

fixed_type() = #avro_fixed_type{name = avro:name(), namespace = avro:namespace(), aliases = [avro:name()], size = pos_integer(), fullname = avro:fullname(), custom = [avro:custom_prop()]}

map_type()

map_type() = #avro_map_type{type = avro:type_or_name(), custom = [avro:custom_prop()]}

name_raw()

name_raw() = atom() | string() | binary()

namespace()

namespace() = binary()

primitive_type()

primitive_type() = #avro_primitive_type{name = avro:name(), custom = [avro:custom_prop()]}

record_type()

record_type() = #avro_record_type{name = avro:name(), namespace = avro:namespace(), doc = avro:typedoc(), aliases = [avro:name()], fields = [avro:record_field()], fullname = avro:fullname(), custom = [avro:custom_prop()]}

type_or_name()

type_or_name() = avro_type() | name_raw()

union_type()

union_type() = #avro_union_type{id2type = avro_union:id2type(), name2id = avro_union:name2id()}

Function Index

get_items/1Returns array contents as a list of avro values.
get_items_type/1Get array element type.
new/1Create a wrapped (boxed) empty array avro value.
new/2Create a wrapped (boxed) avro value with given array data.
new_direct/2Special optimized version of new which assumes that all items in List have been already casted to items type of the array, so we can skip checking types one more time during casting.
prepend/2Prepend elements to the array.
resolve_fullname/2Resolve children type's fullnames.
type/1Define array type.
type/2Define array type with custom properties.
update_items_type/2Update children types by evaluating callback function.

Function Details

get_items/1

get_items(Value::avro_value()) -> [avro_value()]

Returns array contents as a list of avro values.

get_items_type/1

get_items_type(ArrayType::array_type()) -> avro_type()

Get array element type.

new/1

new(Type::array_type()) -> avro_value()

Create a wrapped (boxed) empty array avro value.

new/2

new(Type::array_type(), List::[term()]) -> avro_value() | no_return()

Create a wrapped (boxed) avro value with given array data.

new_direct/2

new_direct(Type::array_type(), List::[avro:in()]) -> avro_value()

Special optimized version of new which assumes that all items in List have been already casted to items type of the array, so we can skip checking types one more time during casting. Should only be used inside erlavro.

prepend/2

prepend(Items0::[term()], Value::avro_value()) -> avro_value() | no_return()

Prepend elements to the array.

resolve_fullname/2

resolve_fullname(Array::array_type(), Ns::namespace()) -> array_type()

Resolve children type's fullnames.

type/1

type(Type::type_or_name()) -> array_type()

Define array type.

type/2

type(Type::type_or_name(), CustomProps::[custom_prop()]) -> array_type()

Define array type with custom properties.

update_items_type/2

update_items_type(Avro_array_type::array_type(), F::fun((type_or_name()) -> type_or_name())) -> array_type()

Update children types by evaluating callback function.


Generated by EDoc