View Source parthenon_schema (parthenon v0.10.1)

Link to this section Summary

Link to this section Types

-type encoder() :: fun((binary(), schema_options()) -> supported_types()).
-type primitive_types() :: integer() | float() | binary() | boolean().
-type schema() :: schema_value().
-type schema_key() :: binary().
-type schema_map() :: {map, encoder(), schema()}.
-type schema_object() :: #{schema_key() := schema_value()}.
-type schema_options() :: #schema_options{}.
API
-type schema_value() :: encoder() | schema_object() | {map_array, schema()} | schema_map().
-type supported_types() :: undefined | primitive_types() | [supported_types()].

Link to this section Functions

-spec create(Schema :: binary() | string()) -> {ok, schema()} | {error, term()}.