Versions in this module Expand all Collapse all v1 v1.0.4 Oct 1, 2025 Changes in this version + var ErrNilContracts = errors.New("contracts cannot be nil") + var ErrNoGoPackagesFound = errors.New("no Go packages found in directory") + var ErrNoPackagesFound = errors.New("no packages found") + var ErrPackageErrors = errors.New("package compilation errors") + var ErrUnsupportedFormat = errors.New("unsupported output format") + type AddedItem struct + Description string + Item string + Type string + type BreakingChange struct + Description string + Item string + NewValue string + OldValue string + Type string + type ConstantContract struct + DocComment string + Name string + Package string + Position PositionInfo + Type string + Value string + type Contract struct + Constants []ConstantContract + Functions []FunctionContract + Interfaces []InterfaceContract + ModulePath string + PackageName string + Timestamp time.Time + Types []TypeContract + Variables []VariableContract + Version string + func LoadFromFile(filename string) (*Contract, error) + func (c *Contract) SaveToFile(filename string) error + type ContractDiff struct + AddedItems []AddedItem + BreakingChanges []BreakingChange + ModifiedItems []ModifiedItem + NewVersion string + OldVersion string + PackageName string + Summary DiffSummary + func LoadDiffFromFile(filename string) (*ContractDiff, error) + func (d *ContractDiff) SaveToFile(filename string) error + type DiffSummary struct + HasBreakingChanges bool + TotalAdditions int + TotalBreakingChanges int + TotalModifications int + type Differ struct + IgnoreComments bool + IgnorePositions bool + func NewDiffer() *Differ + func (d *Differ) Compare(old, new *Contract) (*ContractDiff, error) + type Extractor struct + IncludeInternal bool + IncludePrivate bool + IncludeTests bool + func NewExtractor() *Extractor + func (e *Extractor) ExtractFromDirectory(dir string) (*Contract, error) + func (e *Extractor) ExtractFromPackage(packagePath string) (*Contract, error) + type FieldContract struct + DocComment string + Name string + Position PositionInfo + Tag string + Type string + type FunctionContract struct + DocComment string + Name string + Package string + Parameters []ParameterInfo + Position PositionInfo + Results []ParameterInfo + type InterfaceContract struct + DocComment string + Embedded []string + Methods []MethodContract + Name string + Package string + Position PositionInfo + type MethodContract struct + DocComment string + Name string + Parameters []ParameterInfo + Position PositionInfo + Receiver *ReceiverInfo + Results []ParameterInfo + type ModifiedItem struct + Description string + Item string + NewValue string + OldValue string + Type string + type ParameterInfo struct + Name string + Type string + type PositionInfo struct + Column int + Filename string + Line int + type ReceiverInfo struct + Name string + Pointer bool + Type string + type TypeContract struct + DocComment string + Fields []FieldContract + Kind string + Methods []MethodContract + Name string + Package string + Position PositionInfo + Underlying string + type VariableContract struct + DocComment string + Name string + Package string + Position PositionInfo + Type string