model

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2025 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Document

type Document struct {
	// Basic identity + source reference
	SourceURL string       `json:"source_url,omitempty"`
	Kind      DocumentKind `json:"kind"`

	// Core content
	Title   string `json:"title,omitempty"`
	Excerpt string `json:"excerpt,omitempty"`
	Content string `json:"content,omitempty"`

	// Arbitrary key/value metadata
	Metadata map[string]string `json:"metadata,omitempty"`

	// Structured content
	// Examples:
	//   - article body paragraphs
	//   - feed items
	//   - structured entity fields
	//   - metadata blocks
	Sections []Section `json:"sections,omitempty"`
}

Document is Aether's canonical normalized representation.

Every high-level result—SearchResult, Article, Feed, Entity, JSON API, plugin output—gets converted into this structure before final serialization to JSON or TOON.

Applications consuming Aether should operate on this type rather than on source-specific types (SearchResult, Article, Feed, etc.).

type DocumentKind

type DocumentKind string

DocumentKind classifies the normalized document at a high level.

const (
	// Default / unknown
	DocumentKindUnknown DocumentKind = "unknown"

	// Article-like content (readability extraction)
	DocumentKindArticle DocumentKind = "article"

	// HTML page (non-article or generic)
	DocumentKindHTML DocumentKind = "html_page"

	// RSS/Atom feeds
	DocumentKindFeed DocumentKind = "feed"

	// JSON APIs or JSON resources
	DocumentKindJSON DocumentKind = "json"

	// Plain text pages
	DocumentKindText DocumentKind = "text"

	// Binary or unsupported content
	DocumentKindBinary DocumentKind = "binary"

	// Structured entity (Wikidata, Gov APIs, Marketplace APIs, Plugins)
	DocumentKindEntity DocumentKind = "entity"
)

type Section

type Section struct {
	Role    SectionRole       `json:"role,omitempty"`
	Heading string            `json:"heading,omitempty"`
	Text    string            `json:"text,omitempty"`
	Meta    map[string]string `json:"meta,omitempty"`
}

Section represents a logical content unit within a document. Examples:

  • article body section
  • feed item
  • structured entity (key/values)
  • metadata notes

type SectionRole

type SectionRole string

SectionRole describes the semantic purpose of a section.

const (
	// Traditional article sections
	SectionRoleBody    SectionRole = "body"
	SectionRoleSummary SectionRole = "summary"

	// RSS/Atom feed items
	SectionRoleFeedItem SectionRole = "feed_item"

	// Structured entities (Wikidata, gov APIs, plugin entities)
	SectionRoleEntity SectionRole = "entity"

	// Special metadata sections (fallback)
	SectionRoleMetadata SectionRole = "metadata"

	// Unknown / unspecified
	SectionRoleUnknown SectionRole = "unknown"
)

Jump to

Keyboard shortcuts

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