-
Notifications
You must be signed in to change notification settings - Fork 3
/
typemap.go
42 lines (37 loc) · 924 Bytes
/
typemap.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
41
42
package v3
// automatically generated file, do not edit!
import (
corev2 "github.com/sensu/core/v2"
"github.com/sensu/sensu-api-tools"
)
func init() {
for alias, v := range typeMap {
if _, ok := v.(Resource); ok {
apitools.RegisterType(
"core/v3",
v,
apitools.WithAlias(alias),
apitools.WithResolveHook(resolveResource),
)
}
}
}
// typeMap is used to dynamically look up data types from strings.
var typeMap = map[string]interface{}{
"cluster_config": &ClusterConfig{},
"entity_config": &EntityConfig{},
"entity_state": &EntityState{},
"namespace": &Namespace{},
"resource_template": &ResourceTemplate{},
"symmetric_key": &SymmetricKey{},
}
func resolveResource(v interface{}) {
resource, ok := v.(Resource)
if !ok {
return
}
resource.SetMetadata(&corev2.ObjectMeta{
Labels: make(map[string]string),
Annotations: make(map[string]string),
})
}