Documentation
¶
Index ¶
- type ComponentInfo
- type ComponentManifest
- type Version
- type VersionInfo
- type VersionManifest
- func (manifest *VersionManifest) ContainsVersion(version Version) bool
- func (manifest *VersionManifest) FindVersion(version Version) (VersionInfo, bool)
- func (manifest *VersionManifest) IterVersion(fn func(versionInfo VersionInfo) error) error
- func (manifest *VersionManifest) LatestVersion() Version
- func (manifest *VersionManifest) Sort()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ComponentInfo ¶
type ComponentInfo struct { Name string `json:"name"` Desc string `json:"desc"` Standalone bool `json:"standalone"` Hide bool `json:"hide"` // don't show in component list Platforms []string `json:"platforms"` }
ComponentInfo represents the information of component
func (*ComponentInfo) IsSupport ¶
func (c *ComponentInfo) IsSupport(platform string) bool
IsSupport returns true if the component can be run in current OS and architecture
type ComponentManifest ¶
type ComponentManifest struct { Description string `json:"description"` Modified string `json:"modified"` TiUPVersion Version `json:"tiup_version"` Components []ComponentInfo `json:"components"` }
ComponentManifest represents the all components information of tiup supported
func (*ComponentManifest) FindComponent ¶
func (m *ComponentManifest) FindComponent(component string) (ComponentInfo, bool)
FindComponent find the component by name and returns component info and a bool to indicate whether it exists
func (*ComponentManifest) HasComponent ¶
func (m *ComponentManifest) HasComponent(component string) bool
HasComponent checks whether the manifest contains the specific component
type Version ¶
type Version string
Version represents a version string, like: v3.1.2
type VersionInfo ¶
type VersionInfo struct { Version Version `json:"version"` Date string `json:"date"` Entry string `json:"entry"` Platforms []string `json:"platforms"` }
VersionInfo represents the version information of component
func (*VersionInfo) IsSupport ¶
func (c *VersionInfo) IsSupport(goos, goarch string) bool
IsSupport returns true if the specific version can be run in specified OS and architecture
type VersionManifest ¶
type VersionManifest struct { Description string `json:"description"` Modified string `json:"modified"` Nightly *VersionInfo `json:"nightly"` Versions []VersionInfo `json:"versions"` }
VersionManifest represents the all versions information of specific component
func (*VersionManifest) ContainsVersion ¶
func (manifest *VersionManifest) ContainsVersion(version Version) bool
ContainsVersion returns if the versions contain the specific version
func (*VersionManifest) FindVersion ¶
func (manifest *VersionManifest) FindVersion(version Version) (VersionInfo, bool)
FindVersion returns the specific version info
func (*VersionManifest) IterVersion ¶
func (manifest *VersionManifest) IterVersion(fn func(versionInfo VersionInfo) error) error
IterVersion iterates all versions
func (*VersionManifest) LatestVersion ¶
func (manifest *VersionManifest) LatestVersion() Version
LatestVersion returns the latest stable version