entities

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2026 License: MIT Imports: 0 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package entities defines the runtime representation of Pack entity records.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdaptFlatFixture

func AdaptFlatFixture(configuration map[string]any) map[string]any

AdaptFlatFixture converts legacy golden fixture entities to the runtime shape. Contract fixtures predate entity CRUD and store {id, field...}; Draft collections store {id, fields:{field...}}. This is intentionally test-only input adaptation, not a second runtime shape accepted by Records.

func Values

func Values(records []Record) []any

Values serializes records in the runtime collection shape.

Types

type Record

type Record struct {
	ID     string         `json:"id"`
	Fields map[string]any `json:"fields"`
}

Record is the only entity representation persisted in Draft collections. Entity fields are deliberately nested so the stable entity ID cannot collide with a Pack-defined field name.

func Records

func Records(configuration map[string]any, collection string) []Record

Records reads one runtime entity collection. Invalid values are ignored so complete validation can report the remaining configuration deterministically.

Jump to

Keyboard shortcuts

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