@@ -9,26 +9,26 @@ import (
99)
1010
1111type (
12- // DefaultConnHandler struct
13- DefaultConnHandler struct {
12+ // DefaultHandler struct
13+ DefaultHandler struct {
1414 client * redis.Client
1515 clientOptions * redis.Options
1616 mutex sync.Mutex
1717 }
1818)
1919
20- // NewDefaultConnHandler creates a new connection
20+ // NewDefaultHandler creates a new connection
2121//
2222// Parameters:
2323//
24- // - config Config: configuration for the connection
24+ // - config * Config: configuration for the connection
2525//
2626// Returns:
2727//
28- // - *DefaultConnHandler : connection handler
28+ // - *DefaultHandler : connection handler
2929// - error: error if the config is nil
30- func NewDefaultConnHandler (config Config ) (
31- * DefaultConnHandler ,
30+ func NewDefaultHandler (config * Config ) (
31+ * DefaultHandler ,
3232 error ,
3333) {
3434 // Check if the config is nil
@@ -38,12 +38,12 @@ func NewDefaultConnHandler(config Config) (
3838
3939 // Define the Redis options
4040 clientOptions := & redis.Options {
41- Addr : config .URI () ,
42- Password : config .Password () ,
43- DB : config .Database () ,
41+ Addr : config .URI ,
42+ Password : config .Password ,
43+ DB : config .Database ,
4444 }
4545
46- return & DefaultConnHandler {
46+ return & DefaultHandler {
4747 clientOptions : clientOptions ,
4848 }, nil
4949}
@@ -54,7 +54,7 @@ func NewDefaultConnHandler(config Config) (
5454//
5555// - *redis.Client: Redis client
5656// - error: error if the connection fails or is already established
57- func (d * DefaultConnHandler ) Connect () (* redis.Client , error ) {
57+ func (d * DefaultHandler ) Connect () (* redis.Client , error ) {
5858 if d == nil {
5959 return nil , godatabases .ErrNilConnHandler
6060 }
@@ -89,7 +89,7 @@ func (d *DefaultConnHandler) Connect() (*redis.Client, error) {
8989//
9090// - *redis.Client: Redis client
9191// - error: error if the connection is not established
92- func (d * DefaultConnHandler ) Client () (* redis.Client , error ) {
92+ func (d * DefaultHandler ) Client () (* redis.Client , error ) {
9393 if d == nil {
9494 return nil , godatabases .ErrNilConnHandler
9595 }
@@ -111,7 +111,7 @@ func (d *DefaultConnHandler) Client() (*redis.Client, error) {
111111// Returns:
112112//
113113// - error: error if the disconnection fails
114- func (d * DefaultConnHandler ) Disconnect () error {
114+ func (d * DefaultHandler ) Disconnect () error {
115115 if d == nil {
116116 return godatabases .ErrNilConnHandler
117117 }
0 commit comments