Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type Info ¶
type Info struct { Version string // version string, in Go format Time time.Time `json:",omitempty"` // code timestamp (unreliable) Build string `json:",omitempty"` // Build (semver) / Release (RPM) Epoch int `json:",omitempty"` // versioning Epoch (RPM) }
Info represents module proxy information.
func NewInfo ¶
NewInfo creates a new Info instance with the provided version, time, build, and epoch.
type Version ¶
type Version struct { Epoch int Version string Pre string Commit string Time time.Time Build string }
Version represents a version with epoch, version, pre-release, commit, timestamp, and build.
func FromGo ¶
FromGo creates a Version instance from a Go version string. It parses the version string and extracts components using regular expressions.
func New ¶
New creates a new Version instance from the provided components. It validates and processes each component and returns a Version instance or an error if any component is invalid.
func (*Version) Format ¶
Format returns the version string in the specified format (e.g., "rpm" or "go"). It calls the appropriate method to generate the version string or returns an error if the format is unknown.
func (*Version) Go ¶
Go returns the Go format version string of the Version instance. It constructs the string from the version components, following Go versioning conventions.
func (*Version) Info ¶
Info returns the Info representation of the Version. It creates a new Info instance using the version components.