payload

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package payload imports a normalized Payload CMS export without coupling Ridu to Payload's database schema. Source-specific extractors emit Export; this package owns assessment, chosen-version selection, and Ridu writes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Assessment

type Assessment struct {
	Collections int
	Documents   int
	Versions    int
	Issues      []string
}

func Assess

func Assess(manifest schema.Manifest, source Export) Assessment

type Collection

type Collection struct {
	Slug      string
	Documents []Record
}

type Export

type Export struct {
	Collections []Collection
}

type ID

type ID string

ID is a normalized Payload document ID. JSON strings are preserved exactly; integer JSON numbers are converted to their exact base-10 spelling so Payload's numeric, UUID, and custom IDs share Ridu's canonical string wire representation without passing through float64.

func (ID) MarshalJSON

func (id ID) MarshalJSON() ([]byte, error)

func (ID) String

func (id ID) String() string

func (*ID) UnmarshalJSON

func (id *ID) UnmarshalJSON(encoded []byte) error

type Record

type Record struct {
	ID               ID
	Data             json.RawMessage
	Status           store.Status
	CreatedAt        time.Time
	UpdatedAt        time.Time
	Versions         []Version
	SelectedRevision int
}

type Result

type Result struct {
	Imported int
	IDs      map[string]map[string]string
}

func Import

func Import(ctx context.Context, target Target, source Export, actor *store.Document) (Result, error)

type Target

type Target interface {
	Import(context.Context, string, store.Values, ridu.ImportOptions) (store.Document, error)
}

type Version

type Version struct {
	Revision  int
	Data      json.RawMessage
	Status    store.Status
	CreatedAt time.Time
	UpdatedAt time.Time
}

Jump to

Keyboard shortcuts

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