jsondiff

package
v1.8.5 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JsonOpts

type JsonOpts struct {
	Primitive  TransformPrimitiveJson
	Object     TransformObjectJson
	Array      TransformArrayJson
	Unknown    TransformUnknownJson
	Sensitive  TransformSensitiveJson
	TypeChange TransformTypeChangeJson
}

JsonOpts defines the external callback functions that callers should implement to process the supplied diffs.

func (JsonOpts) Transform

func (opts JsonOpts) Transform(change structured.Change) computed.Diff

Transform accepts a generic before and after value that is assumed to be JSON formatted and transforms it into a computed.Diff, using the callbacks supplied in the JsonOpts class.

type TransformArrayJson

type TransformArrayJson func([]computed.Diff, plans.Action) computed.Diff

type TransformObjectJson

type TransformObjectJson func(map[string]computed.Diff, plans.Action) computed.Diff

type TransformPrimitiveJson

type TransformPrimitiveJson func(before, after interface{}, ctype cty.Type, action plans.Action) computed.Diff

type TransformSensitiveJson

type TransformSensitiveJson func(computed.Diff, bool, bool, plans.Action) computed.Diff

type TransformTypeChangeJson

type TransformTypeChangeJson func(before, after computed.Diff, action plans.Action) computed.Diff

type TransformUnknownJson

type TransformUnknownJson func(computed.Diff, plans.Action) computed.Diff

type Type

type Type string
const (
	Number Type = "number"
	Object Type = "object"
	Array  Type = "array"
	Bool   Type = "bool"
	String Type = "string"
	Null   Type = "null"
)

func GetType

func GetType(val interface{}) Type

Jump to

Keyboard shortcuts

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