clear up useless env file
This commit is contained in:
@@ -1,21 +0,0 @@
|
|||||||
package conf
|
|
||||||
|
|
||||||
import "sync"
|
|
||||||
|
|
||||||
type Config struct {
|
|
||||||
PublicKeyPath string
|
|
||||||
PrivateKeyPath string
|
|
||||||
DHTEndpointPort int64
|
|
||||||
PSKPath string
|
|
||||||
BootstrapAddress string
|
|
||||||
}
|
|
||||||
|
|
||||||
var instance *Config
|
|
||||||
var once sync.Once
|
|
||||||
|
|
||||||
func GetConfig() *Config {
|
|
||||||
once.Do(func() {
|
|
||||||
instance = &Config{}
|
|
||||||
})
|
|
||||||
return instance
|
|
||||||
}
|
|
||||||
6
main.go
6
main.go
@@ -1,7 +1,6 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"oc-catalog/conf"
|
|
||||||
_ "oc-catalog/routers"
|
_ "oc-catalog/routers"
|
||||||
|
|
||||||
oclib "cloud.o-forge.io/core/oc-lib"
|
oclib "cloud.o-forge.io/core/oc-lib"
|
||||||
@@ -27,11 +26,6 @@ func main() {
|
|||||||
o.GetStringDefault("LOKI_URL", ""),
|
o.GetStringDefault("LOKI_URL", ""),
|
||||||
o.GetStringDefault("LOG_LEVEL", "info"),
|
o.GetStringDefault("LOG_LEVEL", "info"),
|
||||||
)
|
)
|
||||||
conf.GetConfig().PSKPath = o.GetStringDefault("PSK_PATH", "./psk/psk")
|
|
||||||
conf.GetConfig().DHTEndpointPort = o.GetInt64Default("DHT_ENDPOINT_PORT", 4002)
|
|
||||||
conf.GetConfig().PublicKeyPath = o.GetStringDefault("CATALOG_PUBLIC_KEY_PATH", "./pem/public.pem")
|
|
||||||
conf.GetConfig().PrivateKeyPath = o.GetStringDefault("CATALOG_PRIVATE_KEY_PATH", "./pem/private.pem")
|
|
||||||
conf.GetConfig().BootstrapAddress = o.GetStringDefault("BOOTSTRAP_ADDRESS", "")
|
|
||||||
// Beego initialization
|
// Beego initialization
|
||||||
beego.BConfig.AppName = appname
|
beego.BConfig.AppName = appname
|
||||||
beego.BConfig.Listen.HTTPPort = o.GetIntDefault("port", 8080)
|
beego.BConfig.Listen.HTTPPort = o.GetIntDefault("port", 8080)
|
||||||
|
|||||||
Reference in New Issue
Block a user