Documentation
¶
Index ¶
- func ParseSpecification(data []byte, config *datamodel.DocumentConfiguration) (libopenapi.Document, libasyncapi.Document, error)
- func SendFatalError(job, message string, errorChan chan ProgressError)
- func SendProgressError(job, message string, errorChan chan ProgressError)
- func SendProgressUpdate(job, message string, completed bool, progressChan chan *ProgressUpdate)
- func SendProgressWarning(job, message string, progressChan chan *ProgressUpdate)
- type Commit
- type ComparisonRules
- type ComparisonSpecification
- type DocumentPathRewriter
- type FlatHistoricalReport
- type FlatReport
- type HashedChange
- type HistoricalReportMetaData
- type HistorySource
- type HistoryWindow
- type ProgressError
- type ProgressUpdate
- type Report
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseSpecification ¶ added in v0.4.0
func ParseSpecification(data []byte, config *datamodel.DocumentConfiguration) (libopenapi.Document, libasyncapi.Document, error)
ParseSpecification parses once and selects the native model by its root version field.
func SendFatalError ¶
func SendFatalError(job, message string, errorChan chan ProgressError)
func SendProgressError ¶
func SendProgressError(job, message string, errorChan chan ProgressError)
func SendProgressUpdate ¶
func SendProgressUpdate(job, message string, completed bool, progressChan chan *ProgressUpdate)
func SendProgressWarning ¶
func SendProgressWarning(job, message string, progressChan chan *ProgressUpdate)
Types ¶
type Commit ¶
type Commit struct {
Specification *ComparisonSpecification `json:"-"`
OriginalRevision string `json:"-"`
ChangeReport whatChanged.Changed `json:"-"`
Source *HistorySource `json:"-"`
Window *HistoryWindow `json:"-"`
Rules *ComparisonRules `json:"-"`
CreatedAt time.Time `json:"-"`
UpdatedAt time.Time `json:"-"`
ID uint `gorm:"primaryKey" json:"-"`
Hash string `json:"commitHash"`
Message string `json:"message"`
Author string `json:"author"`
AuthorEmail string `gorm:"index" json:"authorEmail"`
CommitDate time.Time `json:"committed"`
Changes *wc.DocumentChanges `gorm:"-" json:"changeReport,omitempty"`
AsyncDocument libasyncapi.Document `json:"-"`
OldAsyncDocument libasyncapi.Document `json:"-"`
SerializedChanges []byte `gorm:"-" json:"-"`
Data []byte `gorm:"-" json:"-"`
OldData []byte `gorm:"-" json:"-"`
Document libopenapi.Document `gorm:"-" json:"-"`
OldDocument libopenapi.Document `gorm:"-" json:"-"`
RepoDirectory string `gorm:"-" json:"-"`
FilePath string `gorm:"-" json:"-"`
OriginalSource string `gorm:"-" json:"-"`
ModifiedSource string `gorm:"-" json:"-"`
Synthetic bool `gorm:"-" json:"-"`
DocumentRewriters []DocumentPathRewriter `gorm:"-" json:"-"`
}
func (*Commit) AllChanges ¶ added in v0.4.0
func (c *Commit) AllChanges() whatChanged.Changed
AllChanges returns the active engine report while preserving Changes for callers that consume the existing concrete OpenAPI history API.
func (*Commit) Comparable ¶ added in v0.4.0
Comparable reports whether both sides of a commit contain the same native format.
func (*Commit) PrepareHistory ¶ added in v0.4.0
PrepareHistory returns a comparison copy. Malformed predecessor revisions are bypassed so a valid revision can still compare against the last valid source.
func (*Commit) SetSpecification ¶ added in v0.4.0
func (c *Commit) SetSpecification()
SetSpecification records format metadata without retaining parsed models.
type ComparisonRules ¶ added in v0.4.0
type ComparisonRules struct {
Legacy bool `yaml:"-"` // an unscoped OpenAPI policy must not silently apply to AsyncAPI
OpenAPI *openapi.BreakingRulesConfig `yaml:"openapiRules"`
AsyncAPI *async.BreakingRulesConfig `yaml:"asyncapiRules"`
Schema *openapi.BreakingRulesConfig `yaml:"schemaRules"`
}
ComparisonRules keeps independent policies for each engine. SchemaRules applies to JSON Schemas embedded in AsyncAPI documents only.
type ComparisonSpecification ¶ added in v0.4.0
type ComparisonSpecification struct {
Kind string `json:"kind"`
OriginalVersion string `json:"originalVersion"`
ModifiedVersion string `json:"modifiedVersion"`
}
ComparisonSpecification identifies the native format and versions of both inputs.
type DocumentPathRewriter ¶ added in v0.2.2
type FlatHistoricalReport ¶ added in v0.0.54
type FlatHistoricalReport struct {
GitRepoPath string `json:"gitRepoPath"`
GitFilePath string `json:"gitFilePath"`
Filename string `json:"filename"`
DateGenerated string `json:"dateGenerated,omitempty"`
MetaData *HistoricalReportMetaData `json:"metaData,omitempty"`
Reports []*FlatReport `json:"reports" `
}
type FlatReport ¶ added in v0.0.54
type FlatReport struct {
Specification *ComparisonSpecification `json:"specification,omitempty"`
Summary map[string]*reports.Changed `json:"reportSummary"`
Changes []*HashedChange `json:"changes"`
OriginalPath string `json:"originalPath,omitempty"`
ModifiedPath string `json:"modifiedPath,omitempty"`
DateGenerated string `json:"dateGenerated,omitempty"`
Commit *Commit `gorm:"foreignKey:ID" json:"commitDetails,omitempty"`
}
type HashedChange ¶ added in v0.0.65
type HashedChange struct {
*model.Change
ChangeHash string `json:"changeHash,omitempty"`
RawPath string `json:"rawPath,omitempty"`
}
func (*HashedChange) HashChange ¶ added in v0.0.65
func (hc *HashedChange) HashChange()
func (*HashedChange) MarshalJSON ¶ added in v0.0.65
func (hc *HashedChange) MarshalJSON() ([]byte, error)
type HistoricalReportMetaData ¶ added in v0.2.3
type HistorySource ¶ added in v0.4.0
type HistorySource struct {
Revision string
Data []byte
Previous *HistorySource
Config func() (*datamodel.DocumentConfiguration, error)
}
HistorySource is an immutable revision input. It holds no parsed model.
type HistoryWindow ¶ added in v0.4.0
type HistoryWindow struct {
DiscardIdle bool // console cache entries own their pairs; retain no second idle cache
// contains filtered or unexported fields
}
HistoryWindow retains at most two idle parsed revisions. Active comparisons pin their inputs until Release; callers can safely render before releasing.
func (*HistoryWindow) Acquire ¶ added in v0.4.0
func (w *HistoryWindow) Acquire(source *HistorySource) (libopenapi.Document, libasyncapi.Document, func(), error)
Acquire parses or reuses one revision and pins it until the returned release.
func (*HistoryWindow) Close ¶ added in v0.4.0
func (w *HistoryWindow) Close()
Close releases idle models and releases pinned models when their owners finish.
type ProgressError ¶
func (ProgressError) Error ¶
func (p ProgressError) Error() string