Documentation
¶
Overview ¶
The rbxver package handles parsing and formatting of Roblox version strings.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrSyntax = errors.New("invalid syntax")
ErrSyntax indicates a syntax error while parsing a version string.
Functions ¶
This section is empty.
Types ¶
type Version ¶
type Version struct {
Generation int // The first component.
Version int // The second component.
Patch int // The third component.
Commit int // The fourth component.
// How the version was formatted, or how to format the version.
Format Format
}
Version represents the version of a Roblox build. Versions can be compared for equality.
func Parse ¶
Parse parses s as a version string according to f. Returns the zero value if a version could not be parsed. A correctly parsed version will always have a non-zero Format.
Panics if f is not valid format.
func ParseBytes ¶ added in v0.3.0
ParseBytes parses a version from b according to f.
n returns the number of bytes that were parsed from b. Trailing bytes that are not a part of the parsed version do not cause an error.
err will be ErrSyntax if the syntax is invalid, or io.ErrUnexpectedEOF if b does not have enough bytes to correctly parse the version. In either case, n will indicate where the error occurred.
Panics if f is not valid format.
func (Version) Compare ¶ added in v0.3.0
Compare returns -1 if v is semantically lower than u, 1 if v is semantically higher than u, and 0 if v is semantically equal to u.
func (Version) MarshalJSON ¶ added in v0.3.0
Implements json.Marshaler.
func (*Version) UnmarshalJSON ¶ added in v0.3.0
Implements json.Unmarshaler.