serializer

package
v0.0.0-...-d364ca2 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package serializer keeps persistence models separate from public responses.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Collection

func Collection[T, R any](ctx context.Context, configured Serializer[T, R], entities []*T) ([]R, error)

Collection uses a serializer's optimized collection implementation when available and otherwise preserves input order while serializing each item.

Types

type CollectionSerializer

type CollectionSerializer[T, R any] interface {
	SerializeCollection(context.Context, []*T) ([]R, error)
}

type Func

type Func[T, R any] func(context.Context, *T) (R, error)

func (Func[T, R]) Serialize

func (function Func[T, R]) Serialize(ctx context.Context, entity *T) (R, error)

type Serializer

type Serializer[T, R any] interface {
	Serialize(context.Context, *T) (R, error)
}

Jump to

Keyboard shortcuts

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