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 ¶
Types ¶
type Config ¶
type Config struct {
// Checkers are the checkers to run.
//
// Checkers will be sorted by first categories, then id when Configs are
// created from this package, i.e. created wth ConfigBuilder.NewConfig.
Checkers []Checker
IgnoreIDToRootPaths map[string]map[string]struct{}
IgnoreRootPaths map[string]struct{}
}
Config is the check config.
type ConfigBuilder ¶
type ConfigBuilder struct {
Use []string
Except []string
IgnoreIDOrCategoryToRootPaths map[string][]string
IgnoreRootPaths []string
}
ConfigBuilder is a config builder.
func (ConfigBuilder) NewConfig ¶
func (b ConfigBuilder) NewConfig() (*Config, error)
NewConfig returns a new Config.
type Handler ¶
type Handler interface {
// BreakingCheck 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.
//
// FileAnnotations will use the image file paths, if these should be relative, use
// FixFileAnnotationPaths.
BreakingCheck(
ctx context.Context,
breakingConfig *Config,
previousImage *imagev1beta1.Image,
image *imagev1beta1.Image,
) ([]*filev1beta1.FileAnnotation, error)
}
Handler handles the main breaking functionality.
type Runner ¶
type Runner interface {
// Check runs the breaking checkers, returning a system error if any system error occurs
// or returning the FileAnnotations otherwise.
//
// previousFiles do not need to have Locations, and BreakingCheckers cannot rely on this.
//
// FileAnnotations will be sorted, but Paths will not have the roots as a prefix, instead
// they will be relative to the roots. This should be fixed for linter outputs if image
// mode is not used.
Check(context.Context, *Config, []protodesc.File, []protodesc.File) ([]*filev1beta1.FileAnnotation, error)
}
Runner is a runner.
Click to show internal directories.
Click to hide internal directories.