versioning

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateChangesetSummary

func GenerateChangesetSummary(changesets []*models.Changeset, projectName string) string

GenerateChangesetSummary generates a markdown summary of changesets. This is used for GitHub release notes (especially for snapshot releases).

Types

type Changelog

type Changelog struct {
	// contains filtered or unexported fields
}

Changelog handles reading and writing CHANGELOG.md files

func NewChangelog

func NewChangelog(fs filesystem.FileSystem) *Changelog

NewChangelog creates a new Changelog instance

func (*Changelog) Append

func (cl *Changelog) Append(projectRoot string, entry *ChangelogEntry) error

Append adds a new entry to the changelog

func (*Changelog) FormatEntry

func (cl *Changelog) FormatEntry(changesets []*models.Changeset, projectName, projectRoot string) (string, error)

FormatEntry generates changelog content without version header.

func (*Changelog) GetEntryForVersion

func (cl *Changelog) GetEntryForVersion(projectRoot string, version *models.Version) (string, error)

GetEntryForVersion reads the changelog entry for a specific version

type ChangelogEntry

type ChangelogEntry struct {
	Version    *models.Version
	Date       time.Time
	Changesets []*models.Changeset
}

ChangelogEntry represents an entry to be added to the changelog

type VersionFile

type VersionFile struct {
	// contains filtered or unexported fields
}

VersionFile handles reading and writing version.txt files

func NewVersionFile

func NewVersionFile(fs filesystem.FileSystem) *VersionFile

NewVersionFile creates a new VersionFile instance

func (*VersionFile) IsEnabled

func (vf *VersionFile) IsEnabled(projectRoot string) bool

IsEnabled checks if a project is enabled for versioning Returns false if version.txt contains "false" (case-insensitive) Returns true if version.txt doesn't exist or contains a valid version

func (*VersionFile) Read

func (vf *VersionFile) Read(projectRoot string) (*models.Version, error)

Read reads the version from version.txt in the project root

func (*VersionFile) Write

func (vf *VersionFile) Write(projectRoot string, version *models.Version) error

Write writes the version to version.txt in the project root

type VersionStore

type VersionStore interface {
	Read(projectRoot string) (*models.Version, error)
	Write(projectRoot string, version *models.Version) error
	IsEnabled(projectRoot string) bool
}

VersionStore abstracts reading/writing project versions.

func NewVersionStore

func NewVersionStore(fs filesystem.FileSystem, _ models.ProjectType) VersionStore

NewVersionStore returns the version store for the given project type.

Currently go-changeset supports Go projects only and uses version.txt.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL