diff

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2020 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrDiffStopped is the error returned when a diff opertion is stopped by a callback function
	ErrDiffStopped = errors.New("diff stopped")
)

Functions

func OrderedKeyValueStreams

func OrderedKeyValueStreams(
	leftStream, rightStream <-chan *apiPB.KeyValue,
	onResult OnOrderedKeyValueDiffResult,
) error

OrderedKeyValueStreams diffs two ordered key-value streams. The streams must be closed eventually for the diff to terminate

Types

type KeyValueDiffResult

type KeyValueDiffResult int

KeyValueDiffResult represents a key-value diff result

const (
	// KeyValueEqual means the two key-values are identical
	KeyValueEqual KeyValueDiffResult = iota
	// KeyValueValueDifferent means the two key-values are different in values
	KeyValueValueDifferent
	// KeyValueLeftKeyMissing means the left key-value is missing
	KeyValueLeftKeyMissing
	// KeyValueRightKeyMissing means the right key-value is missing
	KeyValueRightKeyMissing
)

type OnOrderedKeyValueDiffResult

type OnOrderedKeyValueDiffResult func(leftKV, rightKV *apiPB.KeyValue, result KeyValueDiffResult) error

OnOrderedKeyValueDiffResult represents the callback function when a diff result of a key-value is available

Jump to

Keyboard shortcuts

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