Documentation ¶
Index ¶
- Variables
- func Mirror() string
- func ParseCompVersion(spec string) (string, utils.Version)
- func SetGlobalEnv(env *Environment)
- type Environment
- func (env *Environment) BinaryPath(component string, ver utils.Version) (string, error)
- func (env *Environment) Close() error
- func (env *Environment) DownloadComponentIfMissing(component string, ver utils.Version) (utils.Version, error)
- func (env *Environment) GetComponentInstalledVersion(component string, version utils.Version) (utils.Version, error)
- func (env *Environment) LocalPath(path ...string) string
- func (env *Environment) PlatformString() string
- func (env *Environment) Profile() *localdata.Profile
- func (env *Environment) SelectInstalledVersion(component string, ver utils.Version) (utils.Version, error)
- func (env *Environment) SelfUpdate() error
- func (env *Environment) SetProfile(p *localdata.Profile)
- func (env *Environment) UpdateComponents(specs []string, nightly, force bool) error
- func (env *Environment) V1Repository() *repository.V1Repository
Constants ¶
This section is empty.
Variables ¶
var (
DebugMode = false
)
Global flags
var ( // ErrInstallFirst indicates that a component/version is not installed ErrInstallFirst = errors.New("component not installed") )
Functions ¶
func Mirror ¶
func Mirror() string
Mirror return mirror of tiup. If it's not defined, it will use "https://tiup-mirrors.pingcap.com/".
func ParseCompVersion ¶
ParseCompVersion parses component part from <component>[:version] specification
Types ¶
type Environment ¶
type Environment struct {
// contains filtered or unexported fields
}
Environment is the user's fundamental configuration including local and remote parts.
func InitEnv ¶
func InitEnv(options repository.Options) (*Environment, error)
InitEnv creates a new Environment object configured using env vars and defaults.
func (*Environment) BinaryPath ¶
BinaryPath return the installed binary path.
func (*Environment) DownloadComponentIfMissing ¶
func (env *Environment) DownloadComponentIfMissing(component string, ver utils.Version) (utils.Version, error)
DownloadComponentIfMissing downloads the specific version of a component if it is missing
func (*Environment) GetComponentInstalledVersion ¶
func (env *Environment) GetComponentInstalledVersion(component string, version utils.Version) (utils.Version, error)
GetComponentInstalledVersion return the installed version of component.
func (*Environment) LocalPath ¶
func (env *Environment) LocalPath(path ...string) string
LocalPath returns the local path absolute path
func (*Environment) PlatformString ¶
func (env *Environment) PlatformString() string
PlatformString returns a string identifying the current system.
func (*Environment) Profile ¶
func (env *Environment) Profile() *localdata.Profile
Profile returns the profile of local data
func (*Environment) SelectInstalledVersion ¶
func (env *Environment) SelectInstalledVersion(component string, ver utils.Version) (utils.Version, error)
SelectInstalledVersion selects the installed versions and the latest release version will be chosen if there is an empty version
func (*Environment) SelfUpdate ¶
func (env *Environment) SelfUpdate() error
SelfUpdate updates TiUP.
func (*Environment) SetProfile ¶
func (env *Environment) SetProfile(p *localdata.Profile)
SetProfile exports for test
func (*Environment) UpdateComponents ¶
func (env *Environment) UpdateComponents(specs []string, nightly, force bool) error
UpdateComponents updates or installs all components described by specs.
func (*Environment) V1Repository ¶
func (env *Environment) V1Repository() *repository.V1Repository
V1Repository returns the initialized v1 repository