Documentation
¶
Overview ¶
Package what_changed determines what changed between two AsyncAPI documents.
The package compares the low-level models of two parsed documents and produces a hierarchical tree of changes — additions, removals and modifications — each classified as breaking or non-breaking with full YAML line and column context. Breaking classification is driven by a configurable, AsyncAPI shaped rules system in the model sub-package.
Index ¶
- func CompareAsyncAPIDocuments(original, updated *lowasync.AsyncAPI) *model.DocumentChanges
- func CompareAsyncAPIDocumentsWithConfig(original, updated *lowasync.AsyncAPI, config *model.BreakingRulesConfig) *model.DocumentChanges
- func CompareDocuments(original, updated libasyncapi.Document) *model.DocumentChanges
- func CompareDocumentsWithConfig(original, updated libasyncapi.Document, config *model.BreakingRulesConfig) *model.DocumentChanges
- type Changed
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareAsyncAPIDocuments ¶
func CompareAsyncAPIDocuments(original, updated *lowasync.AsyncAPI) *model.DocumentChanges
CompareAsyncAPIDocuments compares two low-level AsyncAPI documents and returns a pointer to model.DocumentChanges describing everything that changed, or nil if nothing changed.
func CompareAsyncAPIDocumentsWithConfig ¶
func CompareAsyncAPIDocumentsWithConfig(original, updated *lowasync.AsyncAPI, config *model.BreakingRulesConfig, ) *model.DocumentChanges
CompareAsyncAPIDocumentsWithConfig compares two low-level AsyncAPI documents using config for this call only. Pass nil to use the default breaking rules.
func CompareDocuments ¶
func CompareDocuments(original, updated libasyncapi.Document) *model.DocumentChanges
CompareDocuments compares two parsed AsyncAPI documents and returns a pointer to model.DocumentChanges describing everything that changed, or nil if nothing changed.
func CompareDocumentsWithConfig ¶
func CompareDocumentsWithConfig(original, updated libasyncapi.Document, config *model.BreakingRulesConfig, ) *model.DocumentChanges
CompareDocumentsWithConfig compares two parsed AsyncAPI documents using config for this call only. Pass nil to use the default breaking rules.
Types ¶
type Changed ¶
type Changed interface {
// GetAllChanges returns all top level changes made to properties in this object,
// including all children.
GetAllChanges() []*model.Change
// TotalChanges returns a count of all changes made on the object, including all children.
TotalChanges() int
// TotalBreakingChanges returns a count of all breaking changes on this object,
// including all children.
TotalBreakingChanges() int
}
Changed represents an object that was changed.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package model contains all the comparison logic and change types used to determine what changed between two AsyncAPI documents.
|
Package model contains all the comparison logic and change types used to determine what changed between two AsyncAPI documents. |
|
Package reports provides summarized, flattened views over the hierarchical change trees produced by the what-changed model.
|
Package reports provides summarized, flattened views over the hierarchical change trees produced by the what-changed model. |