g8 icon indicating copy to clipboard operation
g8 copied to clipboard

feat: ClientProvider.cache as an interface to support external cache (e.g. redis)

Open c-nv-s opened this issue 3 years ago • 1 comments

Describe the feature request

At present it looks like the client provider cache field is tightly coupled to the gocache. If a user wants to also use an external/shared/distributed cache then this isn't possible. It would be nice to allow more flexibility to the user in which caching solution they wish to use.

Why do you personally want this feature to be implemented?

to allow flexibility in choice of cache solution.

How long have you been using this project?

No response

Additional information

No response

c-nv-s avatar Jan 26 '22 02:01 c-nv-s

@TwiN bump

c-nv-s avatar Sep 10 '22 01:09 c-nv-s

@TwiN is this feature still a possibility?

c-nv-s avatar Jan 22 '23 12:01 c-nv-s

@c-nv-s I had started working on the side a bit a few months ago, but this isn't really a priority for me at the moment. Feel free to give a shot at implementing it yourself if you'd like.

TwiN avatar Jan 22 '23 20:01 TwiN

I've pushed the work I currently have and included the work left to do, in case you or somebody else wants to try it to confirm that it fits your need(s).

https://github.com/TwiN/g8/pull/12

TwiN avatar Jan 22 '23 20:01 TwiN

Thanks for this... so you just need to update the go.mod file then I can pull it and start using this?

c-nv-s avatar Apr 05 '23 07:04 c-nv-s

@c-nv-s You should be able to use the master branch as a version in your go.mod, see https://stackoverflow.com/questions/56408476/how-can-i-get-master-branch-of-a-dependency-when-using-go-modules

I haven't had the opportunity to test it myself, hence why I haven't released it yet, but if you could give it a try, that'd be great.

TwiN avatar Apr 06 '23 01:04 TwiN

@c-nv-s I've just release it in v2.0.0

TwiN avatar Apr 11 '23 01:04 TwiN

You are the best! Thanks

c-nv-s avatar Apr 11 '23 08:04 c-nv-s