differ

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package differ reports what changed between two sets of definitions in API terms, after Pandora's data-api-differ: operations, options, bodies, models, fields and enum values added, removed or changed, with the changes that would break a caller of the generated SDK marked. make pandorest-diff runs it on a refreshed spec against the checked-in definitions before they are regenerated.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Change

type Change struct {
	Kind Kind
	// Subject names it: "operation GetItems (GET /Items)".
	Subject string
	// Details are the differences within a changed subject.
	Details []Detail
	// Breaking is set when the change (or any detail) breaks callers.
	Breaking bool
}

Change is one operation, model or constant that differs.

type Detail

type Detail struct {
	Kind     Kind
	Text     string
	Breaking bool
}

Detail is one difference inside a changed subject.

type Kind

type Kind string

Kind is what happened to a subject.

const (
	Added   Kind = "+"
	Removed Kind = "-"
	Changed Kind = "~"
)

The kinds, each the mark it has in a report.

type Report

type Report struct {
	Service string
	// Service-level differences: document version, workarounds applied.
	Notes   []string
	Changes []Change
}

Report is every change between two versions of one service.

func Diff

func Diff(older, newer *definitions.Service) Report

Diff compares old definitions with new ones.

func (*Report) Breaking

func (r *Report) Breaking() bool

Breaking reports whether any change breaks callers.

func (*Report) Empty

func (r *Report) Empty() bool

Empty reports whether nothing differs.

func (*Report) String

func (r *Report) String() string

String renders the report for a terminal.

Jump to

Keyboard shortcuts

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