node

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: MPL-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package node provides the rendered node types

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockDiff

type BlockDiff struct {
	Attributes []*KeyValueDiff
	Blocks     []*NestedBlockDiff
	// contains filtered or unexported fields
}

BlockDiff represents a block diff

func NewBlockDiff

func NewBlockDiff(
	action action.Action,
	replace bool,
	warnings []string,
	attributes []*KeyValueDiff,
	blocks []*NestedBlockDiff,
) *BlockDiff

NewBlockDiff creates a new block diff

func (*BlockDiff) Accept

func (d *BlockDiff) Accept(visitor Visitor)

Accept accepts a visitor

func (BlockDiff) GetAction

func (d BlockDiff) GetAction() action.Action

func (BlockDiff) GetType

func (d BlockDiff) GetType() DiffType

func (BlockDiff) GetWarnings

func (d BlockDiff) GetWarnings() []string

type BoolValueDiff

type BoolValueDiff struct {
	Value bool
	// contains filtered or unexported fields
}

BoolValueDiff represents a bool value

func NewBoolValueDiff

func NewBoolValueDiff(value bool, action action.Action, replace bool) *BoolValueDiff

NewBoolValueDiff creates a new bool value

func (*BoolValueDiff) Accept

func (d *BoolValueDiff) Accept(visitor Visitor)

Accept accepts a visitor

func (BoolValueDiff) GetAction

func (d BoolValueDiff) GetAction() action.Action

func (BoolValueDiff) GetType

func (d BoolValueDiff) GetType() DiffType

func (BoolValueDiff) GetWarnings

func (d BoolValueDiff) GetWarnings() []string

type Diff

type Diff interface {
	// GetType returns the type of the diff
	GetType() DiffType
	// GetWarnings returns the warnings for the diff
	GetWarnings() []string
	// GetAction returns the action for the diff
	GetAction() action.Action
	// Accept accepts a visitor
	Accept(visitor Visitor)
}

Diff is the interface for all diff types

type DiffType

type DiffType string

DiffType is the type of the diff

const (
	DiffTypeBlock       DiffType = "block"
	DiffTypeNestedBlock DiffType = "nested_block"
	DiffTypeJSONObject  DiffType = "json_object"
	DiffTypeJSONArray   DiffType = "json_array"
	DiffTypeKeyValue    DiffType = "key_value"
	DiffTypeUnknown     DiffType = "unknown_value"
	DiffTypeTypeChange  DiffType = "type_change"
	DiffTypePrimitive   DiffType = "primitive"
	DiffTypeJSONString  DiffType = "json_string"
	DiffTypeSensitive   DiffType = "sensitive"
	DiffTypeString      DiffType = "string"
	DiffTypeNumber      DiffType = "number"
	DiffTypeBool        DiffType = "bool"
	DiffTypeNull        DiffType = "null"
)

DiffType constants

type JSONArray

type JSONArray struct {
	Elements []Diff
	// contains filtered or unexported fields
}

JSONArray represents a JSON array diff

func NewJSONArray

func NewJSONArray(action action.Action, replace bool, warnings []string, elements []Diff) *JSONArray

NewJSONArray creates a new JSON array diff

func (*JSONArray) Accept

func (d *JSONArray) Accept(visitor Visitor)

Accept accepts a visitor

func (JSONArray) GetAction

func (d JSONArray) GetAction() action.Action

func (JSONArray) GetType

func (d JSONArray) GetType() DiffType

func (JSONArray) GetWarnings

func (d JSONArray) GetWarnings() []string

type JSONObjectDiff

type JSONObjectDiff struct {
	Attributes []*KeyValueDiff
	// contains filtered or unexported fields
}

JSONObjectDiff represents a JSON diff

func NewJSONObjectDiff

func NewJSONObjectDiff(action action.Action, replace bool, warnings []string, Attributes []*KeyValueDiff) *JSONObjectDiff

NewJSONObjectDiff creates a new JSON diff

func (*JSONObjectDiff) Accept

func (d *JSONObjectDiff) Accept(visitor Visitor)

Accept accepts a visitor

func (JSONObjectDiff) GetAction

func (d JSONObjectDiff) GetAction() action.Action

func (JSONObjectDiff) GetType

func (d JSONObjectDiff) GetType() DiffType

func (JSONObjectDiff) GetWarnings

func (d JSONObjectDiff) GetWarnings() []string

type JSONStringDiff

type JSONStringDiff struct {
	WhitespaceOnlyChange bool
	JSONValue            Diff
	// contains filtered or unexported fields
}

JSONStringDiff represents a JSON string diff

func NewJSONStringDiff

func NewJSONStringDiff(action action.Action, replace bool, warnings []string, value Diff, whitespaceOnlyChange bool) *JSONStringDiff

NewJSONStringDiff creates a new JSON string diff

func (*JSONStringDiff) Accept

func (d *JSONStringDiff) Accept(visitor Visitor)

Accept accepts a visitor

func (JSONStringDiff) GetAction

func (d JSONStringDiff) GetAction() action.Action

func (JSONStringDiff) GetType

func (d JSONStringDiff) GetType() DiffType

func (JSONStringDiff) GetWarnings

func (d JSONStringDiff) GetWarnings() []string

type KeyValueDiff

type KeyValueDiff struct {
	Key            string
	Value          Diff
	BlockAttribute bool
	MaxKeyLength   int
	// contains filtered or unexported fields
}

KeyValueDiff represents a key value diff

func NewKeyValueDiff

func NewKeyValueDiff(action action.Action, warnings []string, key string, value Diff, blockAttribute bool, maxKeyLength int) *KeyValueDiff

NewKeyValueDiff creates a new key value diff

func (*KeyValueDiff) Accept

func (d *KeyValueDiff) Accept(visitor Visitor)

Accept accepts a visitor

func (KeyValueDiff) GetAction

func (d KeyValueDiff) GetAction() action.Action

func (KeyValueDiff) GetType

func (d KeyValueDiff) GetType() DiffType

func (KeyValueDiff) GetWarnings

func (d KeyValueDiff) GetWarnings() []string

type NestedBlockDiff

type NestedBlockDiff struct {
	Name  string
	Label string
	Block Diff
	// contains filtered or unexported fields
}

NestedBlockDiff represents a nested block diff

func NewNestedBlockDiff

func NewNestedBlockDiff(action action.Action, replace bool, warnings []string, name string, label string, block Diff) *NestedBlockDiff

NewNestedBlockDiff creates a new nested block diff

func (*NestedBlockDiff) Accept

func (d *NestedBlockDiff) Accept(visitor Visitor)

Accept accepts a visitor

func (NestedBlockDiff) GetAction

func (d NestedBlockDiff) GetAction() action.Action

func (NestedBlockDiff) GetType

func (d NestedBlockDiff) GetType() DiffType

func (NestedBlockDiff) GetWarnings

func (d NestedBlockDiff) GetWarnings() []string

type NullValueDiff

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

NullValueDiff represents a null value

func NewNullValueDiff

func NewNullValueDiff(action action.Action, replace bool) *NullValueDiff

NewNullValueDiff creates a new null value

func (*NullValueDiff) Accept

func (d *NullValueDiff) Accept(visitor Visitor)

Accept accepts a visitor

func (NullValueDiff) GetAction

func (d NullValueDiff) GetAction() action.Action

func (NullValueDiff) GetType

func (d NullValueDiff) GetType() DiffType

func (NullValueDiff) GetWarnings

func (d NullValueDiff) GetWarnings() []string

type NumberValueDiff

type NumberValueDiff struct {
	Value float64
	// contains filtered or unexported fields
}

NumberValueDiff represents a number value

func NewNumberValueDiff

func NewNumberValueDiff(value float64, action action.Action, replace bool) *NumberValueDiff

NewNumberValueDiff creates a new number value

func (*NumberValueDiff) Accept

func (d *NumberValueDiff) Accept(visitor Visitor)

Accept accepts a visitor

func (NumberValueDiff) GetAction

func (d NumberValueDiff) GetAction() action.Action

func (NumberValueDiff) GetType

func (d NumberValueDiff) GetType() DiffType

func (NumberValueDiff) GetWarnings

func (d NumberValueDiff) GetWarnings() []string

type PrimitiveDiff

type PrimitiveDiff struct {
	Before Diff
	After  Diff
	// contains filtered or unexported fields
}

PrimitiveDiff represents a primitive diff

func NewPrimitiveDiff

func NewPrimitiveDiff(action action.Action, replace bool, warnings []string, before Diff, after Diff) *PrimitiveDiff

NewPrimitiveDiff creates a new primitive diff

func (*PrimitiveDiff) Accept

func (d *PrimitiveDiff) Accept(visitor Visitor)

Accept accepts a visitor

func (PrimitiveDiff) GetAction

func (d PrimitiveDiff) GetAction() action.Action

func (PrimitiveDiff) GetType

func (d PrimitiveDiff) GetType() DiffType

func (PrimitiveDiff) GetWarnings

func (d PrimitiveDiff) GetWarnings() []string

type SensitiveDiff

type SensitiveDiff struct {
	Block           bool
	BeforeSensitive bool
	AfterSensitive  bool
	// contains filtered or unexported fields
}

SensitiveDiff represents a sensitive diff

func NewSensitiveBlockDiff

func NewSensitiveBlockDiff(action action.Action, replace bool, warnings []string, beforeSensitive bool, afterSensitive bool) *SensitiveDiff

NewSensitiveBlockDiff creates a new sensitive block diff

func NewSensitiveDiff

func NewSensitiveDiff(action action.Action, replace bool, warnings []string, beforeSensitive bool, afterSensitive bool) *SensitiveDiff

NewSensitiveDiff creates a new sensitive diff

func (*SensitiveDiff) Accept

func (d *SensitiveDiff) Accept(visitor Visitor)

Accept accepts a visitor

func (SensitiveDiff) GetAction

func (d SensitiveDiff) GetAction() action.Action

func (SensitiveDiff) GetType

func (d SensitiveDiff) GetType() DiffType

func (SensitiveDiff) GetWarnings

func (d SensitiveDiff) GetWarnings() []string

type StringValueDiff

type StringValueDiff struct {
	Value     string
	Multiline bool
	// contains filtered or unexported fields
}

StringValueDiff represents a string value

func NewStringValueDiff

func NewStringValueDiff(value string, action action.Action, replace bool, multiline bool) *StringValueDiff

NewStringValueDiff creates a new string value

func (*StringValueDiff) Accept

func (d *StringValueDiff) Accept(visitor Visitor)

Accept accepts a visitor

func (StringValueDiff) GetAction

func (d StringValueDiff) GetAction() action.Action

func (StringValueDiff) GetType

func (d StringValueDiff) GetType() DiffType

func (StringValueDiff) GetWarnings

func (d StringValueDiff) GetWarnings() []string

type TypeChangeDiff

type TypeChangeDiff struct {
	Before Diff
	After  Diff
	// contains filtered or unexported fields
}

TypeChangeDiff represents a type change diff

func NewTypeChangeDiff

func NewTypeChangeDiff(action action.Action, replace bool, warnings []string, before Diff, after Diff) *TypeChangeDiff

NewTypeChangeDiff creates a new type change diff

func (*TypeChangeDiff) Accept

func (d *TypeChangeDiff) Accept(visitor Visitor)

Accept accepts a visitor

func (TypeChangeDiff) GetAction

func (d TypeChangeDiff) GetAction() action.Action

func (TypeChangeDiff) GetType

func (d TypeChangeDiff) GetType() DiffType

func (TypeChangeDiff) GetWarnings

func (d TypeChangeDiff) GetWarnings() []string

type UnknownDiff

type UnknownDiff struct {
	Before Diff
	// contains filtered or unexported fields
}

UnknownDiff represents an unknown diff

func NewUnknownDiff

func NewUnknownDiff(action action.Action, replace bool, warnings []string, before Diff) *UnknownDiff

NewUnknownDiff creates a new unknown diff

func (*UnknownDiff) Accept

func (d *UnknownDiff) Accept(visitor Visitor)

Accept accepts a visitor

func (UnknownDiff) GetAction

func (d UnknownDiff) GetAction() action.Action

func (UnknownDiff) GetType

func (d UnknownDiff) GetType() DiffType

func (UnknownDiff) GetWarnings

func (d UnknownDiff) GetWarnings() []string

type Visitor

type Visitor interface {
	VisitBlockDiff(diff *BlockDiff)
	VisitNestedBlockDiff(diff *NestedBlockDiff)
	VisitJSONObjectDiff(diff *JSONObjectDiff)
	VisitJSONArray(diff *JSONArray)
	VisitKeyValueDiff(diff *KeyValueDiff)
	VisitUnknownDiff(diff *UnknownDiff)
	VisitTypeChangeDiff(diff *TypeChangeDiff)
	VisitPrimitiveDiff(diff *PrimitiveDiff)
	VisitJSONStringDiff(diff *JSONStringDiff)
	VisitSensitiveDiff(diff *SensitiveDiff)
	VisitStringValueDiff(diff *StringValueDiff)
	VisitNumberValueDiff(diff *NumberValueDiff)
	VisitBoolValueDiff(diff *BoolValueDiff)
	VisitNull(diff *NullValueDiff)
}

Visitor is the interface for visiting diffs

Jump to

Keyboard shortcuts

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