|
@@ -12,11 +12,8 @@ import (
|
|
|
)
|
|
|
|
|
|
type AppConf struct {
|
|
|
- Name string
|
|
|
- Version string
|
|
|
- SaveType string //obs, oss, minio
|
|
|
- IsRelease bool
|
|
|
- IsIgnoreUserType bool
|
|
|
+ Name string
|
|
|
+ Version string
|
|
|
|
|
|
Jwt struct {
|
|
|
Realm string
|
|
@@ -24,14 +21,6 @@ type AppConf struct {
|
|
|
TimeoutHour int
|
|
|
}
|
|
|
|
|
|
- Mysql struct {
|
|
|
- DSN string
|
|
|
- }
|
|
|
- Redis struct {
|
|
|
- Addr string
|
|
|
- Password string // no password set
|
|
|
- Db int // use default DB
|
|
|
- }
|
|
|
Log struct {
|
|
|
FileName string
|
|
|
Level int32
|
|
@@ -58,13 +47,6 @@ type AppConf struct {
|
|
|
HdrProcStreamTopic string
|
|
|
RenderStreamTopic string
|
|
|
}
|
|
|
-
|
|
|
- Obs struct {
|
|
|
- Bucket string
|
|
|
- AccessKeyId string
|
|
|
- SecrateKey string
|
|
|
- Endpoint string
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
func LoadConfFile(filepath string) (*AppConf, error) {
|
|
@@ -94,12 +76,6 @@ func NewAppConf(filePath string) (*AppConf, error) {
|
|
|
//初始化log
|
|
|
_ = log.NewLoggerSugar(c.Log.ServiceName, c.Log.FileName, c.Log.Level)
|
|
|
|
|
|
- //环境变量
|
|
|
- ignoreUserType := os.Getenv("IGNORE_USER_TYPE")
|
|
|
- if strings.ToLower(ignoreUserType) == "true" {
|
|
|
- c.IsIgnoreUserType = true
|
|
|
- }
|
|
|
-
|
|
|
mongo := os.Getenv("CONFIGER_MONGO")
|
|
|
if len(mongo) > 0 {
|
|
|
c.Configer.Mongo = mongo
|
|
@@ -134,13 +110,6 @@ func NewAppConf(filePath string) (*AppConf, error) {
|
|
|
}
|
|
|
fmt.Println("NATS URL =>", c.Nats.Url)
|
|
|
|
|
|
- //是否是正式版本
|
|
|
- IsRelease := os.Getenv("ISRELEASE")
|
|
|
- if len(IsRelease) > 0 {
|
|
|
- c.IsRelease = (IsRelease == "true")
|
|
|
- }
|
|
|
- fmt.Println("IsRelease =>", c.IsRelease)
|
|
|
-
|
|
|
AppConfig = c
|
|
|
|
|
|
return c, nil
|