{"modulePath":"github.com/SovereignCloudStack/cluster-stack-operator","version":"v0.2.0-alpha.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package version\n\nPackage version contains important methods and constants for github release.\n\nPackage version contains important structs and methods for cluster stack versions.\n\n## Constants\n\n```go\nconst (\n\t// ChannelStable is the stable channel.\n\tChannelStable = Channel(\"stable\")\n\t// ChannelCustom is the custom channel where git hash is used in the versioning.\n\tChannelCustom = Channel(\"custom\")\n)\n```\n\n## Types\n\n```go\ntype Channel string\n```\nChannel is the release channel of a cluster stack.\n\n```go\nfunc (c Channel) IsValid() bool\n```\nIsValid returns true if the release channel is valid.\n\n```go\ntype Version struct {\n\tMajor   int\n\tChannel Channel\n\tPatch   string\n}\n```\nVersion encapsulates a Version string into its constituent parts as a struct. Sample: Version string \"v1-alpha-1\" Major: \"v1\" major: 1 (int, after stripping \"v\" prefix) Channel: \"alpha\" Patch: 1.\n\n```go\nfunc FromReleaseTag(releaseTag string) (Version, error)\n```\nFromReleaseTag returns a Version struct from a release tag string.\n\n```go\nfunc New(version string) (Version, error)\n```\nNew returns a Version struct from a version string Sample allowed inputs: \"v1-alpha.1\", \"v1\", \"v1-alpha.0\" Sample disallowed inputs: \"v1-alpha\", \"v1-alpha-1.0\", \"v1-alpha-1.0.0\", \"v1-alpha.\", \"v1.0-alpha.1\".\n\n```go\nfunc ParseVersionString(version string) (Version, error)\n```\nParseVersionString returns a Version struct from a version string like - \"v1\", \"v1-alpha-1\", \"v1-beta-3\", etc.\n\n```go\nfunc (csv Version) Compare(input Version) (int, error)\n```\nCompare compares two Version structs Returns 1 if csv is greater than input Returns -1 if csv is less than input Returns 0 if csv is equal to input Returns error if the two versions are not comparable (different channels).\n\n```go\nfunc (csv Version) String() string\n```\nString converts a Version struct to a string representation. If the channel is stable, it returns the version in the format \"vMajor\". Otherwise, it returns the version in the format \"vMajor-Channel-Patch\".\n\n```go\nfunc (csv Version) StringWithDot() string\n```\nStringWithDot converts a Version struct to a string representation. If the channel is stable, it returns the version in the format \"vMajor\". Otherwise, it returns the version in the format \"vMajor-Channel.Patch\", similar to String but with a dot separating channel and patch.\n\n```go\nfunc (csv *Version) Validate() error\n```\nValidate validates the version.\n\n","path":"github.com/SovereignCloudStack/cluster-stack-operator/pkg/version","name":"version","synopsis":"Package version contains important methods and constants for github release.","isRedistributable":true}
