bufbreaking

package
v1.38.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package bufbreaking contains the breaking change detection functionality.

The primary entry point to this package is the Handler.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAllRules added in v1.32.0

func GetAllRules(fileVersion bufconfig.FileVersion) ([]bufcheck.Rule, error)

GetAllRules gets all known rules for the given version.

Should only be used for testing.

func GetAllRulesV1

func GetAllRulesV1() ([]bufcheck.Rule, error)

GetAllRulesV1 gets all known rules.

Should only be used for printing.

func GetAllRulesV1Beta1

func GetAllRulesV1Beta1() ([]bufcheck.Rule, error)

GetAllRulesV1Beta1 gets all known rules.

Should only be used for printing.

func GetAllRulesV2 added in v1.32.0

func GetAllRulesV2() ([]bufcheck.Rule, error)

GetAllRulesV2 gets all known rules.

Should only be used for printing.

func GetRelevantDeprecations added in v1.32.0

func GetRelevantDeprecations(fileVersion bufconfig.FileVersion) (map[string][]string, error)

GetRelevantDeprecations gets deprecation information for the given version. The map is from deprecated rule IDs to zero or more replacement rule IDs.

func RulesForConfig

func RulesForConfig(config bufconfig.BreakingConfig) ([]bufcheck.Rule, error)

RulesForConfig returns the rules for a given config.

Does NOT include deprecated rules.

Should only be used for printing.

Types

type Handler

type Handler interface {
	// Check runs the breaking checks.
	//
	// The image should have source code info for this to work properly. The previousImage
	// does not need to have source code info.
	//
	// Images should be filtered with regards to imports before passing to this function.
	//
	// An error of type bufanalysis.FileAnnotationSet will be returned on breaking failure.
	Check(
		ctx context.Context,
		config bufconfig.BreakingConfig,
		previousImage bufimage.Image,
		image bufimage.Image,
	) error
}

Handler handles the main breaking functionality.

func NewHandler

func NewHandler(logger *zap.Logger, tracer tracing.Tracer) Handler

NewHandler returns a new Handler.

Directories

Path Synopsis
internal
bufbreakingbuild
Package bufbreakingbuild contains the RuleBuilders used by bufbreakingv*.
Package bufbreakingbuild contains the RuleBuilders used by bufbreakingv*.
bufbreakingcheck
Package bufbreakingcheck impelements the check functions.
Package bufbreakingcheck impelements the check functions.
bufbreakingv1
Package bufbreakingv1 contains the VersionSpec for v1.
Package bufbreakingv1 contains the VersionSpec for v1.
bufbreakingv1beta1
Package bufbreakingv1beta1 contains the VersionSpec for v1beta1.
Package bufbreakingv1beta1 contains the VersionSpec for v1beta1.
bufbreakingv2
Package bufbreakingv2 contains the VersionSpec for v2.
Package bufbreakingv2 contains the VersionSpec for v2.

Jump to

Keyboard shortcuts

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