conf

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VMProxyEnvName                string = "VM_PROXY_URI"
	VMReverseProxyEnvName         string = "VM_REVERSE_PROXY_URL"
	VMWorkDirEnvName              string = "VM_APP_INSTALL_DIR"
	VMDownloadThreadsEnvName      string = "VM_DOWNLOAD_THREADS"
	VMUseMirrorInChinaEnvName     string = "VM_USE_MIRROR_IN_CHINA"
	VMOnlyInCurrentSessionEnvName string = "VM_ONLY_IN_CURRENT_SESSION" // uses a version only in current session.
	VMDiableEnvName               string = "VM_DISABLE"
	VMLockedVersionEnvName        string = "VM_LOCKED_VERSIONS"
)

ENVs 1. Proxies for Version Manager. 2. App installation directories. 3. Multi-thread downloading.

Examples: export VM_PROXY_URI="http://127.0.0.1:2023" export VM_REVERSE_PROXY_URL="https://gvc.1710717.xyz/proxy/" export VM_APP_INSTALL_DIR="~/.vm/"

Variables

This section is empty.

Functions

func DecorateUrl

func DecorateUrl(dUrl string) string

Decorate url with reverse proxy.

func GetAppBinDir

func GetAppBinDir() string

Binaries dir.

func GetConfPath

func GetConfPath() string

func GetFetcher

func GetFetcher() *request.Fetcher

Sets proxy for fetcher.

func GetManagerDir

func GetManagerDir() string

func GetVMTempDir

func GetVMTempDir() string

Temp dir.

func GetVMVersionsDir

func GetVMVersionsDir(appName string) string

versions dir.

func GetVersionManagerWorkDir

func GetVersionManagerWorkDir() string

Apps installation dir.

func GetZipFileDir

func GetZipFileDir(appName string) string

ZipFile dir.

func SaveConfigFile

func SaveConfigFile(c *Config)

func UseMirrorSiteInChina

func UseMirrorSiteInChina() bool

Use mirror site in China.

Types

type Config

type Config struct {
	ProxyURI           string `json:"proxy_uri"`
	ReverseProxy       string `json:"reverse_proxy"`
	AppInstallationDir string `json:"app_installation_dir"`
}

func LoadConfigFile

func LoadConfigFile() (c *Config)

Jump to

Keyboard shortcuts

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