gomemcache
gomemcache copied to clipboard
Support get-and-touch commands
gat and gats were added to the ASCII protocol in memcached 1.5.3 (2017-11-04). They work like get / gets and have the same response format, but have a new first argument that is an expiration time in the same format as touch.
I can implement this, the approach I would take would be:
- Add a param and a conditional in
getFromAddrso that it supports eithergetsorgatsusing the same code path. - Refactor most of
GetMultiinto a private method, so that the public method that's left is similarly as thin asGetorSet. - Add an expiration param to the new private
getMultias well. - Add
GetAndTouch(key string, seconds int32)andGetAndTouchMulti(keys []string, seconds int32).
If that sounds alright, then I'll go ahead, but I figured I would check in on approach first.
@arodland any immediate plans to do this? I think this would be a great add.