Documentation
¶
Overview ¶
Package serializer provides the Serializer interface for the core cache package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Serializer ¶
type Serializer interface {
// Marshal encodes v into bytes.
Marshal(v any) ([]byte, error)
// Unmarshal decodes data into v. v is always a non-nil pointer.
Unmarshal(data []byte, v any) error
}
Serializer encodes and decodes Go values for storage in the L2 adapter.
cache calls Marshal before writing a value to L2 and Unmarshal after reading bytes back from L2. The Serializer is given the inner user value only. cache then wraps it in an envelope with expiry metadata before calling the adapter.
Implementations must be safe for concurrent use.
Click to show internal directories.
Click to hide internal directories.