icey-yu 1110af98ef
feat: config center (#2997)
* chore: config

* chore: config

* chore: config

* chore: config

* chore: config

* feat: config

* fix: config

* fix: config

* feat: config

* feat: config

* feat: config

* feat: config

* feat: config

* feat: config

* feat: config

* feat: config

* feat: config

* feat: config

* feat: config

* feat: config

* feat: config

* feat: config

* feat: config

* feat: config

* feat: config

* feat: config

* fix: config

* fix: config

* fix: config

* fix: config

* fix: config

* fix: config

* fix: config

* fix: config

* fix: config

* fix: config

* fix: config

* fix: config

* fix: config

* fix: config

* fix: config

* fix: config

* fix: config

* fix: config
2024-12-25 10:08:08 +00:00

31 lines
1022 B
Go

package config
import "strings"
var EnvPrefixMap map[string]string
func init() {
EnvPrefixMap = make(map[string]string)
fileNames := []string{
FileName, NotificationFileName, ShareFileName, WebhooksConfigFileName,
KafkaConfigFileName, RedisConfigFileName,
MongodbConfigFileName, MinioConfigFileName, LogConfigFileName,
OpenIMAPICfgFileName, OpenIMCronTaskCfgFileName, OpenIMMsgGatewayCfgFileName,
OpenIMMsgTransferCfgFileName, OpenIMPushCfgFileName, OpenIMRPCAuthCfgFileName,
OpenIMRPCConversationCfgFileName, OpenIMRPCFriendCfgFileName, OpenIMRPCGroupCfgFileName,
OpenIMRPCMsgCfgFileName, OpenIMRPCThirdCfgFileName, OpenIMRPCUserCfgFileName, DiscoveryConfigFilename,
}
for _, fileName := range fileNames {
envKey := strings.TrimSuffix(strings.TrimSuffix(fileName, ".yml"), ".yaml")
envKey = "IMENV_" + envKey
envKey = strings.ToUpper(strings.ReplaceAll(envKey, "-", "_"))
EnvPrefixMap[fileName] = envKey
}
}
const (
FlagConf = "config_folder_path"
FlagTransferIndex = "index"
)