format

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Convert

func Convert(output string, format Type) (string, error)

Convert transforms mysql tabular/TSV output into the specified format.

func ConvertResult added in v0.3.2

func ConvertResult(headers []string, rows [][]string, format Type) (string, error)

ConvertResult converts structured data directly to the specified format, avoiding the round-trip through tabular string serialization.

func WriteFile

func WriteFile(content string, path string) error

WriteFile writes formatted output to a file.

func WritePDF

func WritePDF(output string, path string) error

WritePDF writes mysql output as a PDF file.

func WritePDFResult added in v0.3.2

func WritePDFResult(headers []string, rows [][]string, path string) error

WritePDFResult writes structured data as a PDF file.

Types

type Type

type Type string
const (
	Plain    Type = "plain"
	Markdown Type = "markdown"
	CSV      Type = "csv"
	JSON     Type = "json"
	PDF      Type = "pdf"
)

func Parse

func Parse(s string) (Type, error)

Jump to

Keyboard shortcuts

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