Documentation
¶
Index ¶
- Constants
- func GetCacheDir() string
- func GetDownloadThreadNum() int
- func GetFetcher(dUrl string) (fetcher *request.Fetcher)
- func GetReverseProxyUri(dUrl, localProxy string) string
- func GetSDKInstallationConfDir() string
- func GetSDKInstallationConfFileUrlBySDKName(sdkName string) string
- func GetSDKListFileUrl() string
- func GetTempDir() string
- func GetVMRConfFilePath() string
- func GetVMRWorkDir() string
- func GetVersionFileUrlBySDKName(sdkName string) string
- func GetVersionsDir() string
- func LoadCustomedMirror() map[string]string
- func UseCustomedMirrorUrl(dUrl string) string
- type VMRConf
- func (v *VMRConf) Load()
- func (v *VMRConf) Save()
- func (v *VMRConf) SetDownloadThreadNum(num int)
- func (v *VMRConf) SetProxyUri(sUri string)
- func (v *VMRConf) SetReverseProxy(sUri string)
- func (v *VMRConf) SetVersionHostUrl(hUrl string)
- func (v *VMRConf) ToggleAllowNestedSessions() bool
- func (v *VMRConf) ToggleUseCustomedMirrors()
Constants ¶
View Source
const ( DefaultReverseProxy string = "https://proxy.0002099.xyz/proxy/" DefaultHostUrl string = "https://raw.githubusercontent.com/gvcgo/vsources/main" SDKNameListFileUrl string = `/sdk-list.version.json` VersionFileUrlPattern string = `/%s.version.json` SDKInstallationUrlPattern string = `install/%s.toml` VMRWorkDirName string = ".vmr" )
View Source
const ( VMRSdkInstallationDirEnv string = "VMR_SDK_INSTALLATION_DIR" VMRHostUrlEnv string = "VMR_HOST" VMRReverseProxyEnv string = "VMR_REVERSE_PROXY" VMRLocalProxyEnv string = "VMR_LOCAL_PROXY" VMRDonwloadThreadEnv string = "VMR_DOWNLOAD_THREADS" VMRUseCustomedMirrorEnv string = "VMR_USE_CUSTOMED_MIRRORS" VMRAllowNestedSessionsEnv string = "VMR_ALLOW_NESTED_SESSIONS" )
Envs
Variables ¶
This section is empty.
Functions ¶
func GetFetcher ¶
Prepares request.Fetcher for URL.
func GetSDKInstallationConfDir ¶
func GetSDKInstallationConfDir() string
This directory is for storing sdk installation config files.
func GetSDKInstallationConfFileUrlBySDKName ¶
install/{sdkname}.toml file
func GetTempDir ¶
func GetTempDir() string
Temp directory is for unarchiving sdk files. And will be removed after the temp files are copied to installation directory.
func GetVersionFileUrlBySDKName ¶
{sdkname}.version.json file
func LoadCustomedMirror ¶ added in v0.6.4
func UseCustomedMirrorUrl ¶ added in v0.6.4
Types ¶
type VMRConf ¶
type VMRConf struct {
ProxyUri string `json,toml:"proxy_uri"`
ReverseProxy string `json,toml:"reverse_proxy"`
SDKIntallationDir string `json,toml:"sdk_installation_dir"`
VersionHostUrl string `json,toml:"version_host_url"`
ThreadNum int `json,toml:"download_thread_num"`
UseCustomedMirrors bool `json,toml:"use_customed_mirrors"`
AllowNestedSessions bool `json,toml:"allow_nested_sessions"`
}
============================== vmr config file. ==============================
var DefaultConfig *VMRConf
func NewVMRConf ¶
func NewVMRConf() (v *VMRConf)
func (*VMRConf) SetDownloadThreadNum ¶ added in v0.6.4
func (*VMRConf) SetProxyUri ¶
func (*VMRConf) SetReverseProxy ¶
func (*VMRConf) SetVersionHostUrl ¶
func (*VMRConf) ToggleAllowNestedSessions ¶ added in v0.7.5
func (*VMRConf) ToggleUseCustomedMirrors ¶ added in v0.6.4
func (v *VMRConf) ToggleUseCustomedMirrors()
Click to show internal directories.
Click to hide internal directories.