/
type_keyvaluetags.go
37 lines (33 loc) · 1.28 KB
/
type_keyvaluetags.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
package keyvaluetags
import (
"go/types"
)
const (
KeyValueTagsMethodNameChunks = `Chunks`
KeyValueTagsMethodNameContainsAll = `ContainsAll`
KeyValueTagsMethodNameHash = `Hash`
KeyValueTagsMethodNameIgnore = `Ignore`
KeyValueTagsMethodNameIgnoreAws = `IgnoreAws`
KeyValueTagsMethodNameIgnoreConfig = `IgnoreConfig`
KeyValueTagsMethodNameIgnoreElasticbeanstalk = `IgnoreElasticbeanstalk`
KeyValueTagsMethodNameIgnorePrefixes = `IgnorePrefixes`
KeyValueTagsMethodNameIgnoreRds = `IgnoreRds`
KeyValueTagsMethodNameKeys = `Keys`
KeyValueTagsMethodNameMap = `Map`
KeyValueTagsMethodNameMerge = `Merge`
KeyValueTagsMethodNameRemoved = `Removed`
KeyValueTagsMethodNameUpdated = `Updated`
KeyValueTagsMethodNameUrlEncode = `UrlEncode`
TypeNameKeyValueTags = `KeyValueTags`
)
// IsTypeKeyValueTags returns if the type is KeyValueTags from the internal/keyvaluetags package
func IsTypeKeyValueTags(t types.Type) bool {
switch t := t.(type) {
case *types.Named:
return IsNamedType(t, TypeNameKeyValueTags)
case *types.Pointer:
return IsTypeKeyValueTags(t.Elem())
default:
return false
}
}