Documentation
¶
Index ¶
- type Comparer
- type Formatter
- type Option
- func WithColor(enabled bool) Option
- func WithCommas(commas bool) Option
- func WithHideUnchanged(hideUnchanged bool) Option
- func WithIndentation(indentation string) Option
- func WithIndentedDiffMarkers(indentedDiffMarkers bool) Option
- func WithJSONinJSONCompare(jsonInJSONComparer Comparer) Option
- func WithPatchSeriesPostProcess(patchSeriesPostProcess PatchSeriesPostProcessor) Option
- type PatchSeriesPostProcessor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Comparer ¶
A Comparer compares two JSON documents and returns a JSON patch that transforms the first document into the second document.
type Formatter ¶
type Formatter struct {
// contains filtered or unexported fields
}
Formatter formats the diff if the given JSON patch is applied to the given JSON document.
func NewJSONFormatter ¶
NewJSONFormatter creates a new JSON formatter.
func NewTerraformFormatter ¶
NewTerraformFormatter creates a new Terraform formatter.
type Option ¶
type Option func(*Formatter)
Option is a function that sets an option on the formatter.
func WithColor ¶
WithColor provides an option for the formatter to enable or disable the color full output.
func WithCommas ¶
WithCommas provides an option for the formatter to enable or disable the commas at the end of the JSON items.
func WithHideUnchanged ¶
WithHideUnchanged provides an option for the formatter to enable or disable the hiding of unchanged items. If enabled, unchanged items will not be printed. But instead a summary will be printed mentioning the number of unchanged items. If disabled, all items will be printed.
func WithIndentation ¶
WithIndentation provides an option for the formatter to set the indentation string to use when formatting the output.
func WithIndentedDiffMarkers ¶
WithIndentedDiffMarkers provides an option for the formatter to enable or disable the indentation of the diff markers. If enabled, the diff markers will be indented to match the indentation of the JSON. If disabled, the diff markers will be aligned to the left.
func WithJSONinJSONCompare ¶
WithJSONinJSONCompare provides an option for the formatter to set the comparer to use when comparing JSON in JSON. If not set, JSON in JSON diffing is disabled.
func WithPatchSeriesPostProcess ¶ added in v0.0.6
func WithPatchSeriesPostProcess(patchSeriesPostProcess PatchSeriesPostProcessor) Option
WithPatchSeriesPostProcess provides an option for the formatter to set the post processor to use when processing the patch series.