delta

package
v1.10.12 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package delta provides a distance function for OpenAPI Spec 3. The delta is a numeric value between 0 and 1 representing the distance between base and revision specs.

For any spec, a: delta(a, a) = 0 For any two specs, a and b, with no common elements: delta(a, b) = 1

Symmetric mode: Delta considers both elements of base that are deleted in revision and elements of base that are added in revision. For any two specs, a and b: delta(a, b) = delta(b, a)

Asymmetric mode: Delta only considers elements of base that are deleted in revision but not elements that are missing in base and were added in revision. For any two specs, a and b: Delta(a, b) + Delta(b, a) = 1

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(asymmetric bool, diffReport *diff.Diff) float64

Get returns a numeric value between 0 and 1 representing the distance between base and revision specs

Types

type WeightedDelta

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

func NewWeightedDelta

func NewWeightedDelta(delta float64, weight int) *WeightedDelta

Jump to

Keyboard shortcuts

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