Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatSummary ¶
FormatSummary produces a human-readable summary of the changelog suitable for terminal output. Breaking changes appear first with a warning prefix.
func GenerateFromRepo ¶ added in v1.10.0
func GenerateFromRepo(repoPath string, opts ...GenerateOption) (string, error)
GenerateFromRepo reads git history from the repository at repoPath and produces a full CHANGELOG.md string. The output is compatible with Parse().
Types ¶
type Category ¶
type Category int
Category classifies a change entry.
const ( // CategoryBreaking represents a breaking change requiring user action. CategoryBreaking Category = iota // CategoryFeature represents a new feature. CategoryFeature // CategoryFix represents a bug fix. CategoryFix // CategoryPerformance represents a performance improvement. CategoryPerformance // CategoryOther represents any other change (refactor, docs, chore, etc.). CategoryOther )
type Changelog ¶
type Changelog struct {
// FromVersion is the starting version (exclusive).
FromVersion string
// ToVersion is the ending version (inclusive).
ToVersion string
// Releases contains parsed releases ordered from oldest to newest.
Releases []Release
}
Changelog represents the parsed changelog across multiple releases.
func Parse ¶
Parse parses raw release notes markdown (as returned by SelfUpdater.GetReleaseNotes) into a structured Changelog.
func ParseFromArchive ¶
ParseFromArchive extracts and parses a CHANGELOG.md file from a gzipped tar release archive reader. Returns nil (not an error) if no changelog is found in the archive, allowing callers to fall back to API-based retrieval.
func (*Changelog) BreakingChanges ¶
BreakingChanges returns all breaking change entries across all releases.
func (*Changelog) EntriesByCategory ¶
EntriesByCategory returns all entries matching the given category across all releases.
func (*Changelog) HasBreakingChanges ¶
HasBreakingChanges returns true if any release contains breaking changes.
type Entry ¶
type Entry struct {
// Category is the type of change.
Category Category
// Scope is the conventional commit scope (e.g., "http", "chat"). May be empty.
Scope string
// Description is the change description text.
Description string
// Raw is the original unparsed line from the release notes.
Raw string
}
Entry represents a single change within a release.
type GenerateOption ¶ added in v1.10.0
type GenerateOption func(*generateConfig)
GenerateOption configures changelog generation.
func WithIncludeAll ¶ added in v1.10.0
func WithIncludeAll() GenerateOption
WithIncludeAll includes non-conventional commits under "Other".
func WithMaxReleases ¶ added in v1.10.0
func WithMaxReleases(n int) GenerateOption
WithMaxReleases limits output to the N most recent releases.
func WithSinceTag ¶ added in v1.10.0
func WithSinceTag(tag string) GenerateOption
WithSinceTag limits generation to releases after the given tag.