format

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package format renders result.Result values in json/table/csv/tsv and builds the JSON success/error envelopes consumed by AI agents.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorJSON

func ErrorJSON(code, message string) string

ErrorJSON renders the error envelope.

func Format

func Format(r result.Result, format string) (string, error)

Format renders r in the requested format. csv/tsv encode NULL as empty string; table renders NULL as "NULL"; json is handled by SuccessJSON.

func SuccessJSON

func SuccessJSON(r result.Result, meta map[string]any) string

SuccessJSON renders the success envelope.

Types

This section is empty.

Jump to

Keyboard shortcuts

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