output

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package output provides JSON and NDJSON serialization for items.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Format

type Format string

Format represents the output format.

const (
	FormatJSON   Format = "json"
	FormatNDJSON Format = "ndjson"
)

func ParseFormat

func ParseFormat(s string) Format

ParseFormat parses a format string.

type Writer

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

Writer outputs items in the specified format.

func New

func New(w io.Writer, format Format) *Writer

New creates a new Writer.

func (*Writer) Write

func (w *Writer) Write(items []model.Item) error

Write outputs all items in the configured format.

Jump to

Keyboard shortcuts

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