output

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: AGPL-3.0 Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package output provides the JSONL (newline-delimited JSON) sink for scan reports. Records are written as one JSON object per line, which keeps the format stream-friendly and easy to consume with jq or line-oriented tools.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONLWriter

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

JSONLWriter serializes report records to a writer as JSONL. A nil *JSONLWriter is a valid no-op, so callers never need guards.

func NewFile

func NewFile(path string) (*JSONLWriter, error)

NewFile creates a JSONLWriter that writes to the file at path.

func NewStdout

func NewStdout(w io.Writer) *JSONLWriter

NewStdout creates a JSONLWriter on w, tagged as the stdout sink. It is used when human output has been diverted to stderr but JSONL must keep flowing to the real stdout. The underlying writer is not closed on Close.

func NewWriter

func NewWriter(w io.Writer) *JSONLWriter

NewWriter creates a JSONLWriter on an arbitrary io.Writer. Primarily used by tests. The underlying writer is not closed.

func (*JSONLWriter) Close

func (j *JSONLWriter) Close() error

Close flushes buffered output and closes an owned file handle, if any.

func (*JSONLWriter) Path

func (j *JSONLWriter) Path() string

Path returns the output destination for display purposes. "-" means stdout.

func (*JSONLWriter) Write

func (j *JSONLWriter) Write(record interface{}) error

Write serializes one record. It is safe for concurrent use.

func (*JSONLWriter) WriteCertificate

func (j *JSONLWriter) WriteCertificate(c report.Certificate) error

func (*JSONLWriter) WriteConfig

func (j *JSONLWriter) WriteConfig(c report.Config) error

WriteConfig, WriteCertificate, WriteHost, WriteIP and WriteSummary are small typed conveniences over Write.

func (*JSONLWriter) WriteHost

func (j *JSONLWriter) WriteHost(h report.Host) error

func (*JSONLWriter) WriteIP

func (j *JSONLWriter) WriteIP(i report.IP) error

func (*JSONLWriter) WriteSummary

func (j *JSONLWriter) WriteSummary(s report.Summary) error

Jump to

Keyboard shortcuts

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