diff

package
v4.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangesetLess

func ChangesetLess(c Changeset, i, j int) bool

ChangesetLess returns true if c[i] < c[j].

func CorrectionLess

func CorrectionLess(c []*models.Correction, i, j int) bool

CorrectionLess returns true when comparing corrections.

func DebugKeyMapMap

func DebugKeyMapMap(note string, m map[models.RecordKey][]string)

DebugKeyMapMap debug prints the results from ChangedGroups.

Types

type Changeset

type Changeset []Correlation

Changeset stores many Correlation.

type Correlation

type Correlation struct {
	Existing *models.RecordConfig
	Desired  *models.RecordConfig
	// contains filtered or unexported fields
}

Correlation stores a difference between two records.

func (Correlation) String

func (c Correlation) String() string

type Differ

type Differ interface {
	// IncrementalDiff performs a diff on a record-by-record basis, and returns a sets for which records need to be created, deleted, or modified.
	IncrementalDiff(existing []*models.RecordConfig) (unchanged, create, toDelete, modify Changeset, err error)
	// ChangedGroups performs a diff more appropriate for providers with a "RecordSet" model, where all records with the same name and type are grouped.
	// Individual record changes are often not useful in such scenarios. Instead we return a map of record keys to a list of change descriptions within that group.
	ChangedGroups(existing []*models.RecordConfig) (map[models.RecordKey][]string, error)
}

Differ is an interface for computing the difference between two zones.

func New

func New(dc *models.DomainConfig, extraValues ...func(*models.RecordConfig) map[string]string) Differ

New is a constructor for a Differ.

func NewCompat

func NewCompat(dc *models.DomainConfig, extraValues ...func(*models.RecordConfig) map[string]string) Differ

NewCompat is a constructor that uses the new pkg/diff2 system instead of pkg/diff.

It is for backwards compatibility only. New providers should use pkg/diff2. Older providers should use this to reduce their dependency on pkg/diff2 until they can move to the pkg/diff2/By*() functions.

To use this simply change New() to NewCompat(). If that doesn't work please report a bug. The only exception is if you depend on the extraValues feature, which will not be supported. That parameter must be set to nil.

Jump to

Keyboard shortcuts

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