From 09b49c26ddfdb20ced61e7dfd4192e750ce40449 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Mon, 31 Jul 2017 08:15:23 -0700 Subject: PLT-5308 Caching layer part 2 (#6973) * Adding Reaction store cache layer example * Implementing reaction store in new caching system. * Redis for reaction store * Adding redis library * Adding invalidation for DeleteAllWithEmojiName and other minor enhancements --- store/layered_store_hints.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'store/layered_store_hints.go') diff --git a/store/layered_store_hints.go b/store/layered_store_hints.go index 6154af7c9..064f4f326 100644 --- a/store/layered_store_hints.go +++ b/store/layered_store_hints.go @@ -9,3 +9,23 @@ const ( LSH_NO_CACHE LayeredStoreHint = iota LSH_MASTER_ONLY ) + +func hintsContains(hints []LayeredStoreHint, contains LayeredStoreHint) bool { + for _, hint := range hints { + if hint == contains { + return true + } + } + return false +} + +func hintsContainsAny(hints []LayeredStoreHint, contains ...LayeredStoreHint) bool { + for _, hint := range hints { + for _, hint2 := range contains { + if hint == hint2 { + return true + } + } + } + return false +} -- cgit v1.2.3-1-g7c22