notecontract

package
v1.2.21 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package notecontract provides shared persisted-note fixtures for contract verification.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DirectFixtureNote

func DirectFixtureNote() *activitypub.Note

DirectFixtureNote returns a live-shaped direct-message note fixture with ActivityPub context, DM audiences, mention tags, conversation metadata, and agent attribution.

func Marshal

func Marshal(note *activitypub.Note) (map[string]any, error)

Marshal renders a Status.Note payload into the canonical Dynamo-safe map shape owned by the note contract. The stored field names intentionally preserve the existing nested note layout so readers do not require a migration to hydrate current and future rows.

func Normalize

func Normalize(note *activitypub.Note) (*activitypub.Note, error)

Normalize deep-copies a note through the canonical persisted representation so every write path sees the same contract-owned shape before persistence.

func PublicFixtureNote

func PublicFixtureNote() *activitypub.Note

PublicFixtureNote returns a live-shaped public note fixture with context, audiences, mentions, hashtags, attachments, quote metadata, and agent attribution.

func Unmarshal

func Unmarshal(raw map[string]any) (*activitypub.Note, error)

Unmarshal hydrates the canonical persisted note map back into an ActivityPub Note. It accepts both the canonical stored field names and ActivityPub JSON key aliases so legacy reads and fixture helpers can share one entry point.

Types

This section is empty.

Jump to

Keyboard shortcuts

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