output

package
v0.12.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONProcessor

type JSONProcessor struct {
	// contains filtered or unexported fields
}

JSONProcessor formats the memory index as JSON Note: This is a human-readable/agent-readable JSON format, distinct from the internal storage format. It includes pretty-printing and can be filtered.

func NewJSONProcessor

func NewJSONProcessor(opts ...Options) *JSONProcessor

NewJSONProcessor creates a new JSON output processor

func (*JSONProcessor) Format

func (p *JSONProcessor) Format(index *types.Index) (string, error)

Format renders the index as pretty-printed JSON

func (*JSONProcessor) GetFormat

func (p *JSONProcessor) GetFormat() string

GetFormat returns the format name

type MarkdownProcessor

type MarkdownProcessor struct {
	// contains filtered or unexported fields
}

MarkdownProcessor formats the memory index as Markdown

func NewMarkdownProcessor

func NewMarkdownProcessor(opts ...Options) *MarkdownProcessor

NewMarkdownProcessor creates a new Markdown output processor

func (*MarkdownProcessor) Format

func (p *MarkdownProcessor) Format(index *types.Index) (string, error)

Format renders the index as Markdown

func (*MarkdownProcessor) GetFormat

func (p *MarkdownProcessor) GetFormat() string

GetFormat returns the format name

type Options

type Options struct {
	// ShowRecentDays limits recent activity section to this many days (0 = disabled)
	ShowRecentDays int
}

Options contains formatting options that can be applied to any output processor

func DefaultOptions

func DefaultOptions() Options

DefaultOptions returns the default formatting options

type OutputProcessor

type OutputProcessor interface {
	// Format renders the index in the specific output format
	// Returns the formatted string representation of the index
	Format(index *types.Index) (string, error)

	// GetFormat returns the output format this processor implements
	GetFormat() string
}

OutputProcessor defines the interface for formatting memory index output. Each processor implements a specific output format (XML, Markdown, JSON) and is independent of integration-specific wrappers.

type XMLProcessor

type XMLProcessor struct {
	// contains filtered or unexported fields
}

XMLProcessor formats the memory index as XML

func NewXMLProcessor

func NewXMLProcessor(opts ...Options) *XMLProcessor

NewXMLProcessor creates a new XML output processor

func (*XMLProcessor) Format

func (p *XMLProcessor) Format(index *types.Index) (string, error)

Format renders the index as XML

func (*XMLProcessor) GetFormat

func (p *XMLProcessor) GetFormat() string

GetFormat returns the format name

Jump to

Keyboard shortcuts

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