2019-06-25 11:42:17 +00:00
|
|
|
package build
|
|
|
|
|
2019-12-11 22:00:39 +00:00
|
|
|
var CurrentCommit string
|
|
|
|
|
2019-07-02 17:45:03 +00:00
|
|
|
// Version is the local build version, set by build system
|
2019-12-16 18:49:32 +00:00
|
|
|
const Version = "0.1.2"
|
2019-07-19 10:15:22 +00:00
|
|
|
|
2019-12-11 22:00:39 +00:00
|
|
|
var UserVersion = Version + CurrentCommit
|
|
|
|
|
2019-07-19 10:15:22 +00:00
|
|
|
// APIVersion is a hex semver version of the rpc api exposed
|
|
|
|
//
|
|
|
|
// M M P
|
|
|
|
// A I A
|
|
|
|
// J N T
|
|
|
|
// O O C
|
|
|
|
// R R H
|
|
|
|
// |\vv/|
|
|
|
|
// vv vv
|
2019-12-16 18:49:32 +00:00
|
|
|
const APIVersion = 0x000102
|
2019-07-19 10:15:22 +00:00
|
|
|
|
|
|
|
const (
|
|
|
|
MajorMask = 0xff0000
|
|
|
|
MinorMask = 0xffff00
|
|
|
|
PatchMask = 0xffffff
|
2019-12-11 00:22:58 +00:00
|
|
|
|
|
|
|
MajorOnlyMask = 0xff0000
|
|
|
|
MinorOnlyMask = 0x00ff00
|
|
|
|
PatchOnlyMask = 0x0000ff
|
2019-12-11 14:17:38 +00:00
|
|
|
)
|
2019-10-09 20:18:53 +00:00
|
|
|
|
|
|
|
// VersionInts returns (major, minor, patch) versions
|
|
|
|
func VersionInts(version uint32) (uint32, uint32, uint32) {
|
2019-12-11 00:22:58 +00:00
|
|
|
return (version & MajorOnlyMask) >> 16, (version & MinorOnlyMask) >> 8, version & PatchOnlyMask
|
2019-10-09 20:18:53 +00:00
|
|
|
}
|