mirror of
https://github.com/xvzc/SpoofDPI.git
synced 2024-12-22 22:36:53 +00:00
38 lines
506 B
Go
38 lines
506 B
Go
package config
|
|
|
|
import (
|
|
"sync"
|
|
"runtime"
|
|
)
|
|
|
|
type Config struct {
|
|
Port string
|
|
DNS string
|
|
OS string
|
|
Debug bool
|
|
}
|
|
|
|
var config *Config
|
|
var once sync.Once
|
|
var err error
|
|
|
|
func InitConfig(port string, dns string, debug bool) error {
|
|
err = nil
|
|
|
|
once.Do(func() {
|
|
|
|
config = &Config{
|
|
Port : port,
|
|
DNS : dns,
|
|
OS : runtime.GOOS,
|
|
Debug : debug,
|
|
}
|
|
})
|
|
|
|
return err
|
|
}
|
|
|
|
func GetConfig() (*Config) {
|
|
return config
|
|
}
|