go-zero icon indicating copy to clipboard operation
go-zero copied to clipboard

Can the original redis client be exposed?

Open ethantsien opened this issue 2 years ago • 6 comments

I want to use the original redis client initialized by gozero, because a hook has been added, and the trace is in this hook

ethantsien avatar Sep 04 '23 08:09 ethantsien

We're not going to expose the original redis client, otherwise, it's difficult to upgrade lib without breaking changes.

Would you please show us an example code to demonstrate the details?

kevwan avatar Sep 04 '23 12:09 kevwan

In the dtm barrier, I will use the original *redis.Client. I want to use the original *redis.Client initialized by gozero, because it has added hooks, will record trace spans, etc. Is it possible to add a method like GetRedisNode() RedisNode so that I can get *redis.Client via assertion. If redis.Client cannot be exposed, can hooks be exposed?

ethantsien avatar Sep 04 '23 13:09 ethantsien

You can just use redis.New(...), the underlying connections are shared.

kevwan avatar Sep 06 '23 14:09 kevwan

You can just use redis.New(...), the underlying connections are shared.

i mean the v8 Client and ClusterClient

ethantsien avatar Sep 07 '23 01:09 ethantsien

We're not going to expose v8 clients.

We're planning to upgrade to v9, if we exposed the v8 clients, we cannot keep the compatibility, and the client code should be changed after the release.

kevwan avatar Sep 08 '23 15:09 kevwan

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Sep 11 '24 01:09 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Dec 10 '24 02:12 github-actions[bot]