eko / gocache

☔️ A complete Go cache library that brings you multiple ways of managing your caches
https://vincent.composieux.fr/article/i-wrote-gocache-a-complete-and-extensible-go-cache-library/
MIT License
2.42k stars 192 forks source link

Cannot implement StoreInterface's Invalidate method #175

Closed sgtsquiggs closed 1 year ago

sgtsquiggs commented 1 year ago

Cannot figure out how we're supposed to implement Invalidate since the invalidation options are private. Cannot retrieve the tags that would be passed to the function.

sgtsquiggs commented 1 year ago

I made some sloppy changes on my fork to expose it. I really don't like it but I needed it in a pinch.

https://github.com/eko/gocache/compare/master...sgtsquiggs:gocache:expose-invalidation-options

denis111 commented 1 year ago

the same happens with Set(ctx context.Context, key any, object T, options ...store.Option) because I can't access Option members like expiration...

sgtsquiggs commented 1 year ago

I'll submit a PR and we can get API feedback there.

eko commented 1 year ago

Hi, thanks to all the people working on this subject.

As options are now publicly available, this should be fixed.

I close this issue for now but feel free to reopen if you still have any issue.