summaryrefslogtreecommitdiffstats
path: root/store/layered_store_hints.go
blob: 064f4f32661eb671e84d01684c6cf62a60a73b87 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// 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
}