Is your feature request related to a problem? Please describe.
I rely mostly on the sturdyc.GetOrFetch method to pass a chosen pre-configured cache where needed,
this, however, means that it means a detour to using PermutatedKey alongside it:
// shortLived() returns some pre-configured instance, other ones are available, hence why we use this method.
key := shortLived().PermutatedKey(someInput)
sturdyc.GetOrFetch(ctx, shortLived(), key, func(ctx context.Context) (SomeData, error) {
// do the thing
})
Describe the solution you'd like
I would love to have a plain function version of PermutatedKey.
As far as I understand, PermutatedKey is only attached as a method to use c.log and c.handleTime internal methods. This makes me think it might be possible to provide a plain sturdyc.PermutatedKey function which would be much more useful for workflows like mine.
Happy to help if need be, and thank you for this incredible library, it's wonderful!
Is your feature request related to a problem? Please describe.
I rely mostly on the
sturdyc.GetOrFetchmethod to pass a chosen pre-configured cache where needed,this, however, means that it means a detour to using
PermutatedKeyalongside it:Describe the solution you'd like
I would love to have a plain function version of
PermutatedKey.As far as I understand,
PermutatedKeyis only attached as a method to usec.logandc.handleTimeinternal methods. This makes me think it might be possible to provide a plainsturdyc.PermutatedKeyfunction which would be much more useful for workflows like mine.Happy to help if need be, and thank you for this incredible library, it's wonderful!