Files
mattermost/store/layered_store_hints.go
Christopher Speller 09b49c26dd 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
2017-07-31 08:15:23 -07:00

32 lines
609 B
Go

// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
package store
type LayeredStoreHint int
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
}