mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-03 08:35:59 +08:00
@@ -17,23 +17,18 @@ package config
|
||||
import (
|
||||
_ "embed"
|
||||
"fmt"
|
||||
"github.com/OpenIMSDK/tools/config"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
|
||||
"gopkg.in/yaml.v3"
|
||||
|
||||
"github.com/OpenIMSDK/tools/constant"
|
||||
"github.com/OpenIMSDK/protocol/constant"
|
||||
"github.com/OpenIMSDK/tools/utils"
|
||||
)
|
||||
|
||||
//go:embed version
|
||||
var version string
|
||||
|
||||
func init() {
|
||||
config.Version = version
|
||||
}
|
||||
var Version string
|
||||
|
||||
var (
|
||||
_, b, _, _ = runtime.Caller(0)
|
||||
@@ -47,7 +42,7 @@ const (
|
||||
DefaultFolderPath = "../config/"
|
||||
)
|
||||
|
||||
func GetOptionsByNotification(cfg config.NotificationConf) utils.Options {
|
||||
func GetOptionsByNotification(cfg NotificationConf) utils.Options {
|
||||
opts := utils.NewOptions()
|
||||
if cfg.UnreadCount {
|
||||
opts = utils.WithOptions(opts, utils.WithUnreadCount(true))
|
||||
@@ -92,11 +87,11 @@ func initConfig(config interface{}, configName, configFolderPath string) error {
|
||||
}
|
||||
|
||||
func InitConfig(configFolderPath string) error {
|
||||
err := initConfig(&config.Config, FileName, configFolderPath)
|
||||
err := initConfig(&Config, FileName, configFolderPath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = initConfig(&config.Config.Notification, NotificationFileName, configFolderPath)
|
||||
err = initConfig(&Config.Notification, NotificationFileName, configFolderPath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user