mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-07-26 11:44:22 -04:00
prototype of platform specific code
This commit is contained in:
parent
cdea39ff95
commit
ab84639aaa
16
common/platform/others.go
Normal file
16
common/platform/others.go
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
// +build !windows
|
||||||
|
|
||||||
|
package platform
|
||||||
|
|
||||||
|
import (
|
||||||
|
"os"
|
||||||
|
)
|
||||||
|
|
||||||
|
type otherPlatformEnvironment struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
var environmentInstance = &otherPlatformEnvironment{}
|
||||||
|
|
||||||
|
func (e *otherPlatformEnvironment) ExpandEnv(s string) string {
|
||||||
|
return os.ExpandEnv(s)
|
||||||
|
}
|
10
common/platform/platform.go
Normal file
10
common/platform/platform.go
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
// Package platform provides platform specific functionalities.
|
||||||
|
package platform
|
||||||
|
|
||||||
|
type environment interface {
|
||||||
|
ExpandEnv(s string) string
|
||||||
|
}
|
||||||
|
|
||||||
|
func ExpandEnv(s string) string {
|
||||||
|
return environmentInstance.ExpandEnv(s)
|
||||||
|
}
|
17
common/platform/windows.go
Normal file
17
common/platform/windows.go
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
// +build windows
|
||||||
|
|
||||||
|
package platform
|
||||||
|
|
||||||
|
import (
|
||||||
|
"os"
|
||||||
|
)
|
||||||
|
|
||||||
|
type windowsEnvironment struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
var environmentInstance = &windowsEnvironment{}
|
||||||
|
|
||||||
|
func (e *windowsEnvironment) ExpandEnv(s string) string {
|
||||||
|
// TODO
|
||||||
|
return s
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user