Documentation ¶
Index ¶
- Variables
- func Compare(version1, version2 string) (int, error)
- func LongPrintln()
- func LongString() string
- func Println()
- func String() string
- type SemVer
- func (v *SemVer) Compare(ver *SemVer) int
- func (v *SemVer) Diff(ver *SemVer) *SemVer
- func (v *SemVer) EQ(ver *SemVer) bool
- func (v *SemVer) GE(ver *SemVer) bool
- func (v *SemVer) GT(ver *SemVer) bool
- func (v *SemVer) In(min, max *SemVer) bool
- func (v *SemVer) LE(ver *SemVer) bool
- func (v *SemVer) LT(ver *SemVer) bool
- func (v *SemVer) NE(ver *SemVer) bool
- func (v *SemVer) String() string
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // GitCommit is the git commit that was compiled. This will be filled in by the compiler // in the Makefile from Git short SHA-1 of HEAD commit. GitCommit string // Build is the Jenkins build that compiled this version. This will be filled // in by the compiler in the Makefile from Jenkins build. Build string // Version is the main version number that is being run at the moment. This will be // filled in by the compiler in the Makefile from latest.go Version string // Prerelease is a pre-release marker for the version. If this is "" (empty string) // then it means that it is a final release. Otherwise, this is a pre-release // such as "dev" (in development), "beta", "rc1", etc. Prerelease string // AppName is the application name to show with the version. It may be empty // but looks good to have a name. AppName = "KubeKit" )
Functions ¶
func LongPrintln ¶
func LongPrintln()
LongPrintln prints the version long format using the output of LongString()
func LongString ¶
func LongString() string
LongString return the version in a long format that includes the build number and git commit SHA
Types ¶
type SemVer ¶
type SemVer struct { Major int Minor int Patch int Labels []string // contains filtered or unexported fields }
SemVer is a struct to store a version and do some functions on it
func (*SemVer) Compare ¶
Compare compares two versions in form of SemVer. Rules are: v > ver : 1 v < ver : -1 v == ver : 0
Click to show internal directories.
Click to hide internal directories.