Documentation
¶
Overview ¶
Package codec encodes cache values for the backends that store bytes rather than live objects.
It exists to keep encoding and decoding keyed on the same thing. The compact encoding dispatches on a value's dynamic type, taking a direct path for strings, byte slices and numbers, while decoding dispatches on the static type of its destination. The two agree whenever the cached type is concrete, and disagree exactly when it is an interface: a string stored through a Cache[any] would be written as raw bytes and then read back into an *any, where the compact form is not valid JSON and decoding fails with "unexpected value type". The exported Marshal and Unmarshal route both directions through the static T, which removes the disagreement at its source.
The encoding is process-local and carries no compatibility promise: it is not JSON for scalars, and nothing persists across a restart.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.