transform

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefTimeFormat = time.RFC3339
)

Variables

View Source
var (
	ErrAPIInvalidProperty    = errors.New("field is invalid")
	ErrAPIUnexpectedProperty = errors.New("unexpected field")
)

Functions

func ToList

func ToList[T any, K any](items []*T, toAPI func(T) (*K, error)) ([]K, error)

ToList transforms a slice of items into their API representations. Parameters:

items: input slice of item
total: size of the slice
toAPI: transformation function for single object

Returns transformed slice or error if transformation fails

Types

This section is empty.

Jump to

Keyboard shortcuts

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