Ecto-style schema for Serify models.
Usage:
defmodule MyApp.User do
use WorkerLib.Serify.Model
serify_field :user_id, :u64
serify_field :name, :string
serify_field :email, :string, key: "email_addr"
serify_field :address, :struct, module: Address
serify_field :labels, :map, of: :string
serify_field :scores, :map, of: {:struct, GameScore}
endThis generates:
- to_field_map/1 (struct → map)
- from_field_map/1 (map → struct)