summaryrefslogtreecommitdiffstats
path: root/store/layered_store_hints.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2017-07-31 08:15:23 -0700
committerGitHub <noreply@github.com>2017-07-31 08:15:23 -0700
commit09b49c26ddfdb20ced61e7dfd4192e750ce40449 (patch)
tree1288d069cc8a199b8eb3b858935dffd377ee3d2d /store/layered_store_hints.go
parent6f4e38d129ffaf469d40fc8596d3957ee94d21e9 (diff)
downloadchat-09b49c26ddfdb20ced61e7dfd4192e750ce40449.tar.gz
chat-09b49c26ddfdb20ced61e7dfd4192e750ce40449.tar.bz2
chat-09b49c26ddfdb20ced61e7dfd4192e750ce40449.zip
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
Diffstat (limited to 'store/layered_store_hints.go')
-rw-r--r--store/layered_store_hints.go20
1 files changed, 20 insertions, 0 deletions
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
+}