jsondiffprinter

package module
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 9 Imported by: 7

README

jsondiffprinter

Documentation

Index

Constants

View Source
const (
	KeyValueSeparatorJSON      = `: `
	KeyValueSeparatorTerraform = ` = `

	KeyQuoteJSON      = `"`
	KeyQuoteTerraform = ``

	SingleLineReplaceIndicatorTerraform = `~`

	SingleLineReplaceTransitionIndicatorTerraform = `[yellow][bold]->[reset]`
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Comparer

type Comparer func(before, after any) ([]byte, error)

type Formatter

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

func NewJSONFormatter

func NewJSONFormatter(w io.Writer, options ...Option) Formatter

func NewTerraformFormatter

func NewTerraformFormatter(w io.Writer, options ...Option) Formatter

func (Formatter) Format

func (f Formatter) Format(before any, jsonpatch any) error

type Option

type Option func(*Formatter)

func WithColor

func WithColor(enabled bool) Option

func WithCommas

func WithCommas(commas bool) Option

func WithHideUnchanged

func WithHideUnchanged(hideUnchanged bool) Option

func WithIndentation

func WithIndentation(indentation string) Option

func WithIndentedDiffMarkers

func WithIndentedDiffMarkers(indentedDiffMarkers bool) Option

func WithJSONinJSONCompare

func WithJSONinJSONCompare(jsonInJSONComparer Comparer) Option

Directories

Path Synopsis
cmd module
examples module
internal

Jump to

Keyboard shortcuts

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