-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
40 lines (35 loc) · 927 Bytes
/
types.go
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
32
33
34
35
36
37
38
39
40
package tat
// Version of Tat
var Version string
const (
// TatHeaderUsername is Tat_username header
TatHeaderUsername = "Tat_username"
// TatHeaderPassword is Tat_password header
TatHeaderPassword = "Tat_password"
// TatHeaderXTatRefererLower contains tat microservice name & version "X-TAT-FROM"
TatHeaderXTatRefererLower = "X-Tat-Referer"
)
// ArrayContains return true if element is in array
func ArrayContains(array []string, element string) bool {
for _, cur := range array {
if cur == element {
return true
}
}
return false
}
// ItemInBothArrays return true if an element is in both array
func ItemInBothArrays(arrayA, arrayB []string) bool {
for _, cura := range arrayA {
for _, curb := range arrayB {
if cura == curb {
return true
}
}
}
return false
}
//CacheableCriteria must return strnig slice describing the redis key
type CacheableCriteria interface {
CacheKey() []string
}