writer

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Console

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

Console is a scan.Writer implementation that writes the output to the given io.Writer, following console/terminal standards in a human-friendly fashion.

func NewConsole

func NewConsole(writer io.Writer) Console

NewConsole creates a new instance of Console with the given io.Writer.

func (Console) WriteConfig

func (c Console) WriteConfig(_ context.Context, cfg scan.Config) error

WriteConfig writes the scan.Config to the console.

func (Console) WriteError

func (c Console) WriteError(_ context.Context, scanError scan.Error) error

WriteError writes the scan.Error to the console.

func (Console) WriteErrors

func (c Console) WriteErrors(ctx context.Context, fs scan.FileSystem) error

WriteErrors writes the scan.Error instances to the console.

func (Console) WriteMatch

func (c Console) WriteMatch(_ context.Context, m scan.Match, includeResponse bool) error

WriteMatch writes the scan.Match to the console.

func (Console) WriteMatches

func (c Console) WriteMatches(ctx context.Context, fs scan.FileSystem, includeResponses bool) error

WriteMatches writes the scan.Match instances found during the scan, to the console.

func (Console) WriteMatchesSummary

func (c Console) WriteMatchesSummary(ctx context.Context, fs scan.FileSystem) error

WriteMatchesSummary writes a summary of the scan.Match instances found during the scan, to the console.

func (Console) WriteStats

func (c Console) WriteStats(ctx context.Context, fs scan.FileSystem) error

WriteStats writes the scan.Stats to the console.

func (Console) WriteTasks

func (c Console) WriteTasks(ctx context.Context, fs scan.FileSystem, allRequests, allResponses bool) error

WriteTasks writes the scan.TaskSummary instances to the console.

type JSON

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

JSON is a scan.Writer implementation that writes the output to the given io.Writer, in a machine-readable format (JSON).

func NewJSON

func NewJSON(writer io.Writer) JSON

NewJSON creates a new instance of JSON with the given io.Writer.

func (JSON) WriteConfig

func (j JSON) WriteConfig(_ context.Context, cfg scan.Config) error

WriteConfig writes the scan.Config to the io.Writer as a JSON object.

func (JSON) WriteError

func (j JSON) WriteError(_ context.Context, scanError scan.Error) error

WriteError writes a scan.Error to the io.Writer as a JSON object.

func (JSON) WriteErrors

func (j JSON) WriteErrors(ctx context.Context, fs scan.FileSystem) error

WriteErrors writes the scan.Error instances to the io.Writer as a JSON array of JSON objects.

func (JSON) WriteMatch

func (j JSON) WriteMatch(_ context.Context, m scan.Match, includeResponse bool) error

WriteMatch writes a scan.Match to the io.Writer as a JSON object.

func (JSON) WriteMatches

func (j JSON) WriteMatches(ctx context.Context, fs scan.FileSystem, includeResponses bool) error

WriteMatches writes the scan.Match instances found during the scan, as a JSON array of JSON objects.

func (JSON) WriteMatchesSummary

func (j JSON) WriteMatchesSummary(ctx context.Context, fs scan.FileSystem) error

WriteMatchesSummary writes a summary of the scan.Match instances found during the scan, to the io.Writer as a JSON array of JSON objects.

func (JSON) WriteStats

func (j JSON) WriteStats(ctx context.Context, fs scan.FileSystem) error

WriteStats writes the scan.Stats to the io.Writer as a JSON object.

func (JSON) WriteTasks

func (j JSON) WriteTasks(ctx context.Context, fs scan.FileSystem, allRequests, allResponses bool) error

WriteTasks writes the scan.TaskSummary instances to the io.Writer as a JSON array of JSON objects.

type Markdown

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

Markdown is a scan.Writer implementation that writes the output to the given io.Writer, in a styled human-readable format (Markdown).

func NewMarkdown

func NewMarkdown(writer io.Writer) Markdown

NewMarkdown creates a new instance of Markdown with the given io.Writer.

func (Markdown) WriteConfig

func (md Markdown) WriteConfig(_ context.Context, cfg scan.Config) error

WriteConfig writes the scan.Config to the io.Writer in the Markdown format.

func (Markdown) WriteError

func (md Markdown) WriteError(_ context.Context, scanError scan.Error) error

WriteError writes a scan.Error to the io.Writer in the Markdown format.

func (Markdown) WriteErrors

func (md Markdown) WriteErrors(ctx context.Context, fs scan.FileSystem) error

WriteErrors writes the scan.Error instances to the io.Writer in the Markdown format.

func (Markdown) WriteMatch

func (md Markdown) WriteMatch(_ context.Context, m scan.Match, includeResponse bool) error

WriteMatch writes a scan.Match to the io.Writer in the Markdown format.

func (Markdown) WriteMatches

func (md Markdown) WriteMatches(ctx context.Context, fs scan.FileSystem, includeResponses bool) error

WriteMatches writes the scan.Match instances found during the scan, in the Markdown format.

func (Markdown) WriteMatchesSummary

func (md Markdown) WriteMatchesSummary(ctx context.Context, fs scan.FileSystem) error

WriteMatchesSummary writes a summary of the scan.Match instances found during the scan, to the io.Writer in the Markdown format.

func (Markdown) WriteStats

func (md Markdown) WriteStats(ctx context.Context, fs scan.FileSystem) error

WriteStats writes the scan.Stats to the io.Writer in the Markdown format.

func (Markdown) WriteTasks

func (md Markdown) WriteTasks(ctx context.Context, fs scan.FileSystem, allRequests, allResponses bool) error

WriteTasks writes the scan.TaskSummary instances to the io.Writer in the Markdown format.

type Plain

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

Plain is a scan.Writer implementation that writes the output to the given io.Writer, as plain text. The format is quite similar to Console but without colors.

func NewPlain

func NewPlain(writer io.Writer) Plain

NewPlain creates a new instance of Plain with the given io.Writer.

func (Plain) WriteConfig

func (p Plain) WriteConfig(_ context.Context, cfg scan.Config) error

WriteConfig writes the scan.Config to the io.Writer as plain text.

func (Plain) WriteError

func (p Plain) WriteError(_ context.Context, scanError scan.Error) error

WriteError writes a scan.Error to the io.Writer as plain text.

func (Plain) WriteErrors

func (p Plain) WriteErrors(ctx context.Context, fs scan.FileSystem) error

WriteErrors writes the scan.Error instances to the io.Writer as plain text.

func (Plain) WriteMatch

func (p Plain) WriteMatch(_ context.Context, m scan.Match, includeResponse bool) error

WriteMatch writes a scan.Match to the io.Writer as plain text.

func (Plain) WriteMatches

func (p Plain) WriteMatches(ctx context.Context, fs scan.FileSystem, includeResponses bool) error

WriteMatches writes the scan.Match instances found during the scan, as plain text.

func (Plain) WriteMatchesSummary

func (p Plain) WriteMatchesSummary(ctx context.Context, fs scan.FileSystem) error

WriteMatchesSummary writes a summary of the scan.Match instances found during the scan, to the io.Writer as plain text.

func (Plain) WriteStats

func (p Plain) WriteStats(ctx context.Context, fs scan.FileSystem) error

WriteStats writes the scan.Stats to the io.Writer as plain text.

func (Plain) WriteTasks

func (p Plain) WriteTasks(ctx context.Context, fs scan.FileSystem, allRequests, allResponses bool) error

WriteTasks writes the scan.TaskSummary instances to the io.Writer as plain text.

Jump to

Keyboard shortcuts

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