Documentation
¶
Overview ¶
Package version parses request version labels ("1", "1.1", "2.0.1") and resolves which version a request node runs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrNoVersions = errors.New("request has no versions") ErrPinnedMissing = errors.New("pinned version does not exist") ErrDefaultMissing = errors.New("default version does not exist") )
Errors returned by Resolve.
var ErrInvalidLabel = errors.New("invalid version label")
ErrInvalidLabel is returned for labels that are not dotted non-negative integers without leading zeros.
Functions ¶
func Normalize ¶
Normalize trims a typed label and strips a leading "v", "ver", "ver." or "version" (any case, with dots, colons or spaces after it) when a number follows: "Version 1.2" is "1.2". Anything else is returned trimmed and as typed, for Parse to accept or refuse. Every place that takes a label from a person (the GUI, the CLI, the library's own save) uses it, so they agree.
Types ¶
type Label ¶
type Label struct {
// contains filtered or unexported fields
}
Label is a parsed version label. The zero value is not a valid label.