codec

package
v0.0.0-...-8a86631 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package codec defines the Codec interface and provides factory functions to create different output format encoders such as CSV, JSON, and HTML. A Codec is responsible for writing tabular data to an output stream.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Codec

type Codec interface {
	Write(rows scanner.Rows, writer io.Writer) error
}

Codec defines the interface for encoding and writing tabular data from a scanner.Rows source to an io.Writer.

func CSV

func CSV(opts ...csvcodec.Option) Codec

CSV returns a Codec that writes data in CSV format. Optional configuration can be provided via functional options.

func HTML

func HTML(opts ...htmlcodec.Option) Codec

HTML returns a Codec that writes data as an HTML table. Optional configuration can be provided via functional options.

func JSON

func JSON(opts ...jsoncodec.Option) Codec

JSON returns a Codec that writes data in JSON format. Optional configuration can be provided via functional options.

func XML

func XML(opts ...xmlcodec.Option) Codec

XML returns a Codec that writes data in XML format. Optional configuration can be provided via functional options.

Directories

Path Synopsis
Package csvcodec provides an implementation of the Codec interface for writing data in CSV (Comma-Separated Values) format.
Package csvcodec provides an implementation of the Codec interface for writing data in CSV (Comma-Separated Values) format.
Package htmlcodec provides an HTML implementation of the Codec interface, generating well-formatted HTML tables with optional headers, NULL styling, row preprocessing, and type-specific string conversion.
Package htmlcodec provides an HTML implementation of the Codec interface, generating well-formatted HTML tables with optional headers, NULL styling, row preprocessing, and type-specific string conversion.
Package jsoncodec provides a JSON implementation of the Codec interface, allowing tabular data to be exported in either standard JSON array format or newline-delimited JSON (JSON Lines).
Package jsoncodec provides a JSON implementation of the Codec interface, allowing tabular data to be exported in either standard JSON array format or newline-delimited JSON (JSON Lines).
Package xmlcodec provides an XML implementation of the Codec interface, generating well-formatted XML tables with optional headers, NULL styling, row preprocessing, and type-specific string conversion.
Package xmlcodec provides an XML implementation of the Codec interface, generating well-formatted XML tables with optional headers, NULL styling, row preprocessing, and type-specific string conversion.

Jump to

Keyboard shortcuts

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