compat

package
v0.72.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package compat checks backward compatibility between schema versions. It walks both descriptor trees and reports violations that would break existing consumers relying on protobuf wire compatibility.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Result

type Result struct {
	Violations []Violation
}

Result holds the outcome of a compatibility check.

func Check

func Check(old, new *snapshot.Snapshot) *Result

Check compares old and new snapshots for backward compatibility violations. It checks all files in the old snapshot against corresponding files in the new snapshot.

func (*Result) Error

func (r *Result) Error() string

Error returns all violations as a single error string.

func (*Result) OK

func (r *Result) OK() bool

OK returns true if there are no violations.

type Violation

type Violation struct {
	// File is the proto file where the violation occurred.
	File string
	// Path is the fully-qualified path of the element (e.g. "acme.Config.timeout_ms").
	Path string
	// Rule is the machine-readable rule identifier.
	Rule string
	// Message is a human-readable description.
	Message string
}

Violation describes a single backward compatibility violation.

func (*Violation) Error

func (v *Violation) Error() string

Error implements the error interface for a single violation.

Jump to

Keyboard shortcuts

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