Documentation
¶
Overview ¶
Package versionmgr manages version updates across multiple file formats. All file paths are from hardcoded GetAllTargets() with no user input. #nosec G304 G306 -- File paths are validated, controlled by tool, and files must be world-readable
Package versionmgr manages atomic version updates with backup/rollback. #nosec G304 G306 -- File paths are from GetAllTargets(), no user input, files must be readable
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteCanonicalVersion ¶
WriteCanonicalVersion writes the version to the VERSION file
Types ¶
type DriftReport ¶
type DriftReport struct {
CanonicalVersion Version
Files []FileVersionInfo
HasDrift bool
TotalFiles int
FilesInSync int
FilesWithDrift int
MissingFiles int
}
DriftReport contains the results of drift detection
func DetectDrift ¶
func DetectDrift(repoRoot string) (*DriftReport, error)
DetectDrift scans all files and compares versions to the VERSION file
func (*DriftReport) ExitCode ¶
func (r *DriftReport) ExitCode() int
ExitCode returns the appropriate exit code for the drift report 0 = no drift, 1 = drift detected
func (*DriftReport) PrintReport ¶
func (r *DriftReport) PrintReport(verbose bool)
PrintReport prints a human-readable drift report
func (*DriftReport) PrintSummary ¶
func (r *DriftReport) PrintSummary()
PrintSummary prints a brief summary without detailed file info
type FileTarget ¶
type FileTarget struct {
Path string
Description string
UpdateFunc func(path string, version Version) error
ExtractFunc func(path string) ([]string, error)
}
FileTarget represents a file that contains version information
func GetAllTargets ¶
func GetAllTargets(repoRoot string) []FileTarget
GetAllTargets returns all files that need version updates
type FileVersionInfo ¶
type FileVersionInfo struct {
Target FileTarget
Exists bool
Versions []string
ParsedVersions []Version
InSync bool
Error error
}
FileVersionInfo contains version information for a single file
type UpdateResult ¶
type UpdateResult struct {
Target FileTarget
Success bool
Error error
}
UpdateResult contains the result of updating a file
type Updater ¶
type Updater struct {
// contains filtered or unexported fields
}
Updater handles version updates across all files
func NewUpdater ¶
NewUpdater creates a new Updater
func (*Updater) UpdateAllFiles ¶
func (u *Updater) UpdateAllFiles(version Version) ([]UpdateResult, error)
UpdateAllFiles updates all registered files to the specified version Returns list of results and error if any update fails
type Version ¶
Version represents a semantic version (MAJOR.MINOR.PATCH)
func ParseVersion ¶
ParseVersion parses a semantic version string. Accepts formats: "1.0.1", "v1.0.1", "1.0", "v1.0"
func ReadCanonicalVersion ¶
ReadCanonicalVersion reads the version from the VERSION file