优化结构
This commit is contained in:
@@ -6,13 +6,13 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"kra/internal/conf"
|
||||
"kra/internal/config"
|
||||
|
||||
"go.mongodb.org/mongo-driver/mongo"
|
||||
"go.mongodb.org/mongo-driver/mongo/options"
|
||||
)
|
||||
|
||||
func mongoURI(config *conf.Data_Mongo) string {
|
||||
func mongoURI(config *config.Mongo) string {
|
||||
hosts := make([]string, 0, len(config.Hosts))
|
||||
for _, host := range config.Hosts {
|
||||
if host != nil && host.Host != "" && host.Port != "" {
|
||||
@@ -26,7 +26,7 @@ func mongoURI(config *conf.Data_Mongo) string {
|
||||
return uri
|
||||
}
|
||||
|
||||
func openMongo(config *conf.Data_Mongo, enabled bool) (*mongo.Client, error) {
|
||||
func openMongo(config *config.Mongo, enabled bool) (*mongo.Client, error) {
|
||||
if !enabled {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user