Help us shape the future of Go! Take the 2026 Go Developer Survey

output

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package output renders acurl reports in human and machine formats.

Index

Constants

View Source
const (
	ExitOK      = 0 // every profile was allowed
	ExitBlocked = 1 // at least one profile was blocked or challenged
	ExitError   = 2 // a request failed, or acurl itself failed
)

Exit codes returned by acurl.

View Source
const Caveat = "acurl sends agent user-agent strings from your own IP address. Real AI agents " +
	"come from published IP ranges and may sign their requests, so these results show how a " +
	"site responds to user-agent strings, not guaranteed agent access."

Caveat explains what acurl results do and do not prove.

Variables

View Source
var Formats = []string{"table", "json", "markdown"}

Formats lists the supported output formats.

Functions

func ExitCode

func ExitCode(s types.Summary) int

ExitCode maps a summary to a process exit code.

func FormatSize

func FormatSize(n int) string

FormatSize renders a byte count as B, KB or MB.

func Write

func Write(w io.Writer, format string, result types.ComparisonResult, color bool) error

Write renders result in format to w.

func WriteDiff added in v0.2.0

func WriteDiff(w io.Writer, baseName, otherName string, lines []textdiff.Line, color bool) error

WriteDiff prints a line diff of the visible text two profiles received.

func WriteJSON

func WriteJSON(w io.Writer, result types.ComparisonResult) error

WriteJSON renders result as indented JSON.

func WriteMarkdown

func WriteMarkdown(w io.Writer, result types.ComparisonResult) error

WriteMarkdown renders result as a GitHub-flavored Markdown report.

func WriteRobotsAudit added in v0.2.0

func WriteRobotsAudit(w io.Writer, format string, a types.RobotsAudit, color bool) error

WriteRobotsAudit renders a robots.txt audit as a table or JSON.

func WriteTable

func WriteTable(w io.Writer, result types.ComparisonResult, color bool) error

WriteTable renders result as a terminal table.

Types

This section is empty.

Jump to

Keyboard shortcuts

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