Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrPinnedTrackSwitch = errors.New("cannot switch pinned track")
Functions ¶
func Resolve ¶
Resolve resolves newChannel wrt channel, this means if newChannel is risk/branch only it will preserve the track of channel. It assumes that if both are not empty, channel is parseable.
func ResolvePinned ¶
ResolvePinned resolves newChannel wrt a pinned track, newChannel can only be risk/branch-only or have the same track, otherwise ErrPinnedTrackSwitch is returned.
Types ¶
type Channel ¶
type Channel struct { Architecture string `json:"architecture"` Name string `json:"name"` Track string `json:"track"` Risk string `json:"risk"` Branch string `json:"branch,omitempty"` }
Channel identifies and describes completely a store channel.
func Parse ¶
Parse parses a string representing a store channel and includes given architecture, , if architecture is "" the system architecture is included. The returned channel's track, risk and name are normalized.
func ParseVerbatim ¶
ParseVerbatim parses a string representing a store channel and includes the given architecture, if architecture is "" the system architecture is included. The channel representation is not normalized. Parse() should be used in most cases.
func (*Channel) Full ¶
Full returns the full name of the channel, inclusive the default track "latest".
func (*Channel) Match ¶
func (c *Channel) Match(c1 *Channel) ChannelMatch
Match returns a ChannelMatch of which fields among architecture,track,risk match between c and c1 store channels, risk is matched taking channel inheritance into account and considering c the requested channel.
func (*Channel) VerbatimRiskOnly ¶
VerbatimRiskOnly returns whether the channel represents a risk only.
func (*Channel) VerbatimTrackOnly ¶
VerbatimTrackOnly returns whether the channel represents a track only.
type ChannelMatch ¶
ChannelMatch represents on which fields two channels are matching.
func (ChannelMatch) String ¶
func (cm ChannelMatch) String() string
String returns the string represantion of the match, results can be:
"architecture:track:risk" "architecture:track" "architecture:risk" "track:risk" "architecture" "track" "risk" ""