cnf

package
v0.7.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

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 GetCacheDir

func GetCacheDir() string

cache file dir:

where the downloaded files are stored.

func GetDownloadThreadNum added in v0.6.4

func GetDownloadThreadNum() int

Get download thread num

func GetFetcher

func GetFetcher(dUrl string) (fetcher *request.Fetcher)

Prepares request.Fetcher for URL.

func GetReverseProxyUri

func GetReverseProxyUri(dUrl, localProxy string) string

reverse proxy

func GetSDKInstallationConfDir

func GetSDKInstallationConfDir() string

This directory is for storing sdk installation config files.

func GetSDKInstallationConfFileUrlBySDKName

func GetSDKInstallationConfFileUrlBySDKName(sdkName string) string

install/{sdkname}.toml file

func GetSDKListFileUrl

func GetSDKListFileUrl() string

sdk-list.version.json

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 GetVMRConfFilePath

func GetVMRConfFilePath() string

vmr conf file path.

func GetVMRWorkDir

func GetVMRWorkDir() string

vmr work dir:

where vmr is installed.

func GetVersionFileUrlBySDKName

func GetVersionFileUrlBySDKName(sdkName string) string

{sdkname}.version.json file

func GetVersionsDir

func GetVersionsDir() string

versions dir:

where the versions are installed.

func LoadCustomedMirror added in v0.6.4

func LoadCustomedMirror() map[string]string

func UseCustomedMirrorUrl added in v0.6.4

func UseCustomedMirrorUrl(dUrl string) string

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) Load

func (v *VMRConf) Load()

func (*VMRConf) Save

func (v *VMRConf) Save()

func (*VMRConf) SetDownloadThreadNum added in v0.6.4

func (v *VMRConf) SetDownloadThreadNum(num int)

func (*VMRConf) SetProxyUri

func (v *VMRConf) SetProxyUri(sUri string)

func (*VMRConf) SetReverseProxy

func (v *VMRConf) SetReverseProxy(sUri string)

func (*VMRConf) SetVersionHostUrl

func (v *VMRConf) SetVersionHostUrl(hUrl string)

func (*VMRConf) ToggleAllowNestedSessions added in v0.7.5

func (v *VMRConf) ToggleAllowNestedSessions() bool

func (*VMRConf) ToggleUseCustomedMirrors added in v0.6.4

func (v *VMRConf) ToggleUseCustomedMirrors()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL