serializer

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 27, 2026 License: MIT Imports: 0 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL