Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CanonicalRef ¶
CanonicalRef returns the canonicalized ref for the given ref.
func IsValidRef ¶
IsValidRef returns true if the given ref is a valid ref.
func IsValidStream ¶
IsValidStream returns true if the given stream is a valid stream.
Types ¶
type Fetcher ¶
type Fetcher struct {
// contains filtered or unexported fields
}
Fetcher fetches a list of versions.
type Latest ¶
type Latest struct { // Ref is the branch name this latest version belongs to. Ref string `json:"ref,omitempty"` // Stream is stream name this latest version belongs to. Stream string `json:"stream,omitempty"` // Kind is the kind of resource this latest version is for. Kind string `json:"kind,omitempty"` // Version is the latest version for this ref, stream and kind. Version string `json:"version,omitempty"` }
Latest is the latest version of a kind of resource.
type List ¶
type List struct { // Ref is the branch name the list belongs to. Ref string `json:"ref,omitempty"` // Stream is the update stream of the list. Stream string `json:"stream,omitempty"` // Granularity is the granularity of the base version of this list. // It can be either "major" or "minor". Granularity string `json:"granularity,omitempty"` // Base is the base version of the list. // Every version in the list is a finer-grained version of this base version. Base string `json:"base,omitempty"` // Kind is the kind of resource this list is for. Kind string `json:"kind,omitempty"` // Versions is a list of all versions in this list. Versions []string `json:"versions,omitempty"` }
List represents a list of versions for a kind of resource. It has a granularity of either "major" or "minor".
For example, a List with granularity "major" could contain the base version "v1" and a list of minor versions "v1.0", "v1.1", "v1.2" etc. A List with granularity "minor" could contain the base version "v1.0" and a list of patch versions "v1.0.0", "v1.0.1", "v1.0.2" etc.
func (*List) Validate ¶
Validate checks if the list is valid. This performs the following checks: - The ref is set. - The stream is supported. - The granularity is "major" or "minor". - The kind is supported. - The base version is a valid semantic version that matches the granularity. - All versions in the list are valid semantic versions that are finer-grained than the base version.