mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-14 22:15:59 +08:00
feat: add kafka and redis mongo env
Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com>
This commit is contained in:
@@ -15,6 +15,8 @@
|
||||
package kafka
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/IBM/sarama"
|
||||
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/common/config"
|
||||
@@ -33,3 +35,12 @@ func SetupTLSConfig(cfg *sarama.Config) {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// getEnvOrConfig returns the value of the environment variable if it exists,
|
||||
// otherwise, it returns the value from the configuration file.
|
||||
func getEnvOrConfig(envName string, configValue string) string {
|
||||
if value, exists := os.LookupEnv(envName); exists {
|
||||
return value
|
||||
}
|
||||
return configValue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user