chore: package path changes

Signed-off-by: withchao <993506633@qq.com>
This commit is contained in:
withchao
2023-07-26 16:56:25 +08:00
parent 78daeec424
commit eaeb342b0e
99 changed files with 580 additions and 134 deletions
+5 -10
View File
@@ -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
}