diff --git a/go.mod b/go.mod index 1f577d9..8303802 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.17 require ( github.com/Selly-Modules/logger v0.0.0-20210809034923-140a51f39ec9 - github.com/Selly-Modules/mongodb v0.0.0-20211013094205-a8ab24a96c4c + github.com/Selly-Modules/mongodb v1.0.1 github.com/go-redis/redis/v8 v8.11.4 github.com/logrusorgru/aurora v2.0.3+incompatible github.com/thoas/go-funk v0.9.1 diff --git a/go.sum b/go.sum index c6dfcfc..1a0ad24 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,8 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/Selly-Modules/logger v0.0.0-20210809034923-140a51f39ec9 h1:AuJ/IIZ7yppyP19ILEYkwz26CwGXR4xUyXANKSG0+1U= github.com/Selly-Modules/logger v0.0.0-20210809034923-140a51f39ec9/go.mod h1:RWhSQ3F01an8KD00VjzRBZOMcE5eV2Cy0/l4ZkeieyU= -github.com/Selly-Modules/mongodb v0.0.0-20211013094205-a8ab24a96c4c h1:1l6QmAl43maG9zFyUXrPQVUjyVt0vy/2Saz992UR+Sc= -github.com/Selly-Modules/mongodb v0.0.0-20211013094205-a8ab24a96c4c/go.mod h1:C9O0Bgl9i6szjntMjBdEvaFSqG2UPOgHUspIWIJ93JQ= +github.com/Selly-Modules/mongodb v1.0.1 h1:TeBIs2VG4EbE0uAN71bD11zv5X0M7AvJfEcID3TzwIw= +github.com/Selly-Modules/mongodb v1.0.1/go.mod h1:OhqdqYqh8WqEEruz6U27Wu1kKoBLwIUQsc+56xl0Wcs= github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= diff --git a/usermngmt.go b/usermngmt.go index c825fd3..b1215ce 100644 --- a/usermngmt.go +++ b/usermngmt.go @@ -6,17 +6,13 @@ import ( "github.com/Selly-Modules/logger" "github.com/Selly-Modules/mongodb" + "github.com/Selly-Modules/usermngmt/cache" configMoudle "github.com/Selly-Modules/usermngmt/config" "github.com/Selly-Modules/usermngmt/database" "github.com/Selly-Modules/usermngmt/internal" ) -// MongoDBConfig ... -type MongoDBConfig struct { - Host, User, Password, DBName, Mechanism, Source string -} - // RedisConfig ... type RedisConfig struct { URI, Password string @@ -25,7 +21,7 @@ type RedisConfig struct { // Config ... type Config struct { // MongoDB config, for save documents - MongoDB MongoDBConfig + MongoDB mongodb.Config // Redis Redis RedisConfig @@ -59,14 +55,7 @@ func Init(config Config) (*Service, error) { } // Connect MongoDB - db, err := mongodb.Connect( - config.MongoDB.Host, - config.MongoDB.User, - config.MongoDB.Password, - config.MongoDB.DBName, - config.MongoDB.Mechanism, - config.MongoDB.Source, - ) + db, err := mongodb.Connect(config.MongoDB) if err != nil { fmt.Println("Cannot init module User MANAGEMENT", err) return nil, err