cnf

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultReverseProxy       string = "https://proxy.vmr.us.kg/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"
)

Envs

Variables

This section is empty.

Functions

func GetCacheDir

func GetCacheDir() string

cache file dir:

where the downloaded files are stored.

func GetFetcher

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

Prepares request.Fetcher for URL.

func GetReverseProxyUri

func GetReverseProxyUri() 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.

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"`
}

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

Jump to

Keyboard shortcuts

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