@rivascva/dt-idl 1.1.181 → 1.1.182
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/go/redis/baserdb.go +11 -7
- package/package.json +1 -1
package/go/redis/baserdb.go
CHANGED
|
@@ -43,18 +43,22 @@ type BaseRDB struct {
|
|
|
43
43
|
verboseLog log.Logger
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
func NewBaseRDB(
|
|
46
|
+
func NewBaseRDB(url string, service string) (RDB, error) {
|
|
47
|
+
// parse the connection url
|
|
48
|
+
opts, err := goredis.ParseURL(url)
|
|
49
|
+
if err != nil {
|
|
50
|
+
return nil, fmt.Errorf("failed to parse the url: %w", err)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// create the redis client
|
|
54
|
+
client := goredis.NewClient(opts)
|
|
55
|
+
|
|
47
56
|
//exhaustruct:ignore - other fields are optional
|
|
48
|
-
client := goredis.NewClient(&goredis.Options{
|
|
49
|
-
Addr: address,
|
|
50
|
-
Username: username,
|
|
51
|
-
Password: password,
|
|
52
|
-
})
|
|
53
57
|
return &BaseRDB{
|
|
54
58
|
client: client,
|
|
55
59
|
database: service,
|
|
56
60
|
verboseLog: nil,
|
|
57
|
-
}
|
|
61
|
+
}, nil
|
|
58
62
|
}
|
|
59
63
|
|
|
60
64
|
func (r *BaseRDB) NewRDB(database string) RDB {
|