Documentation ¶
Overview ¶
The version package implements version parsing. It also acts as guardian of the current client Juju version number.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Current = Binary{ Number: CurrentNumber(), Series: CurrentSeries(), Arch: CurrentArch(), }
Current gives the current version of the system. If the file "FORCE-VERSION" is present in the same directory as the running binary, it will override this.
var Zero = Number{}
Zero is occasionally convenient and readable. Please don't change its value.
Functions ¶
func CurrentSeries ¶
func CurrentSeries() string
CurrentSeries returns the current Ubuntu release name.
Types ¶
type Binary ¶
Binary specifies a binary version of juju.
func MustParseBinary ¶
MustParseBinary parses a binary version and panics if it does not parse correctly.
func ParseBinary ¶
ParseBinary parses a binary version of the form "1.2.3-series-arch".
func (Binary) GetBSON ¶
GetBSON turns v into a bson.Getter so it can be saved directly on a MongoDB database with mgo.
func (Binary) MarshalJSON ¶
func (*Binary) SetBSON ¶
SetBSON turns v into a bson.Setter so it can be loaded directly from a MongoDB database with mgo.
func (*Binary) UnmarshalJSON ¶
type Number ¶
Number represents a juju version. When bugs are fixed the patch number is incremented; when new features are added the minor number is incremented and patch is reset; and when compatibility is broken the major version is incremented and minor and patch are reset. The build number is automatically assigned and has no well defined sequence. If the build number is greater than zero or the minor version is odd, it indicates that the release is still in development.
func Parse ¶
Parse parses the version, which is of the form 1.2.3 giving the major, minor and release versions respectively.
func (Number) GetBSON ¶
GetBSON turns v into a bson.Getter so it can be saved directly on a MongoDB database with mgo.
func (Number) IsDev ¶
IsDev returns whether the version represents a development version. A version with an odd-numbered minor component or a nonzero build component is considered to be a development version.
func (Number) MarshalJSON ¶
func (*Number) SetBSON ¶
SetBSON turns v into a bson.Setter so it can be loaded directly from a MongoDB database with mgo.