In-memory struct store backed by SuperCache ETS partitions.
Works transparently in both local and distributed modes — the
mode is determined by the :cluster option passed to SuperCache.start!/1.
Call init/2 once per struct type before using add/1, get/1, etc.
Read modes (distributed)
Pass read_mode: :primary or read_mode: :quorum for stronger consistency.
Example
alias SuperCache.Struct, as: S
defmodule Order do
defstruct [:id, :customer, :status]
end
S.init(%Order{}, :id)
S.add(%Order{id: "o-1", customer: "Alice", status: :pending})
S.get(%Order{id: "o-1"})
# => {:ok, %Order{id: "o-1", customer: "Alice", status: :pending}}