Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidSemver = errors.New("invalid semantic version")
ErrInvalidSemver the given version is not a valid semantic version.
Functions ¶
This section is empty.
Types ¶
type SemanticVersion ¶
type SemanticVersion struct { // RawValue string value used to parse semver structure. RawValue string // Major the major version (e.g. v1, v15). Major string // MajorMinor major version along minor version as well (e.g. v1.5, v3.5, v66.120). MajorMinor string // Canonical the canonical formatting of the semantic version v. It fills in any missing .MINOR or .PATCH and discards build metadata. Canonical string // Build the build suffix of the semantic version v. For example, Build("v2.1.0+meta") == "+meta". If v is an invalid // semantic version string, Build will be an empty string. Build string // Prerelease the prerelease suffix of the semantic version v. For example, Prerelease("v2.1.0-pre+meta") == "-pre". // If v is an invalid semantic version string, Prerelease will be an empty string. Prerelease string }
SemanticVersion informational structure containing semantic version metadata.
Implements fmt.Stringer, encoding.TextMarshaler and encoding.TextUnmarshaler interfaces.
func NewSemanticVersion ¶
func NewSemanticVersion(rawValue string) (SemanticVersion, error)
NewSemanticVersion parses and allocates a new SemanticVersion.
func (SemanticVersion) MarshalText ¶
func (s SemanticVersion) MarshalText() (text []byte, err error)
func (SemanticVersion) String ¶
func (s SemanticVersion) String() string
func (*SemanticVersion) UnmarshalText ¶
func (s *SemanticVersion) UnmarshalText(text []byte) error
Click to show internal directories.
Click to hide internal directories.