formatter

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package formatter provides the framework-level Formatter and IOWriter implementations. Standard dispatches the stream formats (json, ndjson); table rendering is provided by pkg/integrations/formatting.TableView and assembled by product-level DefaultProcessor() functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultProcessor

func DefaultProcessor() *frameworkoutput.Processor

DefaultProcessor returns a Processor that handles json/ndjson only, with the built-in select + envelope hooks. Products that need table rendering should call pkg/integrations/formatting.DefaultProcessor() instead.

Types

type Standard

type Standard struct{}

Standard handles the two stream formats (json, ndjson). Table dispatch lives in the mid-layer; Standard returns an error if asked to format "table" so a misconfigured Processor fails loudly.

func (Standard) Format

func (Standard) Format(data any, opts *frameworkoutput.FormatOptions) ([]byte, error)

type Stdio

type Stdio struct{}

Stdio writes payload to the writer carried by the output.Context. It is a no-op in IOModeProgrammatic, where the caller collects the result from state.Result directly.

func (Stdio) Write

func (Stdio) Write(ctx *frameworkoutput.Context, payload []byte) error

Jump to

Keyboard shortcuts

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