printer

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONPrinter

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

JSONPrinter prints diffs as JSON, making it easily parseable for tools like jq or jiq.

func NewJSONPrinter

func NewJSONPrinter(w io.Writer, unchanged, updated, created, deleted bool) *JSONPrinter

NewJSONPrinter creates a new JSONPrinter.

func (*JSONPrinter) Print

func (p *JSONPrinter) Print(d diff.Diff) error

Print prints a diff as JSON.

type Printer

type Printer interface {
	Print(diff.Diff) error
}

Printer prints a diff using a specific output format, e.g. JSON.

type StdPrinter

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

StdPrinter uses a textual description for diffs.

func NewStdPrinter

func NewStdPrinter(w io.WriteCloser, unchanged, updated, created, deleted bool) *StdPrinter

NewStdPrinter creates a new StdPrinter.

func (*StdPrinter) Print

func (p *StdPrinter) Print(d diff.Diff) error

Print prints a diff in a textual form. It e.g. doesn't print a diff for unchanged documents.

Jump to

Keyboard shortcuts

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