1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-01-03 07:45:29 -05:00

prototype for plugins

This commit is contained in:
Darien Raymond
2017-11-22 23:00:46 +01:00
parent bfafd06863
commit 6069b77baa
3 changed files with 73 additions and 0 deletions

View File

@@ -53,8 +53,20 @@ func getExecutableDir() string {
return filepath.Dir(exec)
}
func getExecuableSubDir(dir string) func() string {
return func() string {
return filepath.Join(getExecutableDir(), dir)
}
}
func GetAssetLocation(file string) string {
const name = "v2ray.location.asset"
assetPath := EnvFlag{Name: name, AltName: NormalizeEnvName(name)}.GetValue(getExecutableDir)
return filepath.Join(assetPath, file)
}
func GetPluginDirectory() string {
const name = "v2ray.location.plugin"
pluginDir := EnvFlag{Name: name, AltName: NormalizeEnvName(name)}.GetValue(getExecuableSubDir("plugins"))
return pluginDir
}