Documentation ¶
Overview ¶
Package version implements version parsing.
Index ¶
- Variables
- func ParseMajorMinor(vers string) (int, int, error)
- type Binary
- func (b Binary) GetBSON() (interface{}, error)
- func (b Binary) MarshalJSON() ([]byte, error)
- func (b Binary) MarshalYAML() (interface{}, error)
- func (b *Binary) SetBSON(raw bson.Raw) error
- func (b Binary) String() string
- func (b *Binary) UnmarshalJSON(data []byte) error
- func (b *Binary) UnmarshalYAML(unmarshal func(interface{}) error) error
- type Number
- func (n Number) Compare(other Number) int
- func (n Number) GetBSON() (interface{}, error)
- func (n Number) MarshalJSON() ([]byte, error)
- func (n Number) MarshalYAML() (interface{}, error)
- func (n *Number) SetBSON(raw bson.Raw) error
- func (n Number) String() string
- func (n *Number) UnmarshalJSON(data []byte) error
- func (n *Number) UnmarshalYAML(unmarshal func(interface{}) error) error
Constants ¶
This section is empty.
Variables ¶
var Zero = Number{}
Zero is occasionally convenient and readable. Please don't change its value.
Functions ¶
Types ¶
type Binary ¶
Binary specifies a binary version of juju.v
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) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (Binary) MarshalYAML ¶
MarshalYAML implements yaml.v2.Marshaller interface.
func (*Binary) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
func (*Binary) UnmarshalYAML ¶
UnmarshalYAML implements the yaml.Unmarshaller interface.
type Number ¶
Number represents a version number.
func Parse ¶
Parse parses the version, which is of the form 1.2.3 giving the major, minor and release versions respectively.
func (Number) Compare ¶
Compare returns -1, 0 or 1 depending on whether n is less than, equal to or greater than other. The comparison compares Major, then Minor, then Patch, then Build, using the first difference as
func (Number) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (Number) MarshalYAML ¶
MarshalYAML implements yaml.v2.Marshaller interface
func (*Number) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
func (*Number) UnmarshalYAML ¶
UnmarshalYAML implements the yaml.Unmarshaller interface