entities

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: MIT Imports: 0 Imported by: 0

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