1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package types
17
18 import (
19 "go.uber.org/fx"
20
21 "github.com/chaos-mesh/chaos-mesh/api/v1alpha1"
22 )
23
24 type Controller string
25
26
27
28
29 type Object struct {
30
31 Object v1alpha1.InnerObject
32
33
34 Name string
35 }
36
37
38
39 var ChaosObjects = fx.Supply(
40 fx.Annotated{
41 Group: "objs",
42 Target: Object{
43 Name: "awschaos",
44 Object: &v1alpha1.AWSChaos{},
45 },
46 },
47
48 fx.Annotated{
49 Group: "objs",
50 Target: Object{
51 Name: "dnschaos",
52 Object: &v1alpha1.DNSChaos{},
53 },
54 },
55
56 fx.Annotated{
57 Group: "objs",
58 Target: Object{
59 Name: "httpchaos",
60 Object: &v1alpha1.HTTPChaos{},
61 },
62 },
63
64 fx.Annotated{
65 Group: "objs",
66 Target: Object{
67 Name: "iochaos",
68 Object: &v1alpha1.IOChaos{},
69 },
70 },
71
72 fx.Annotated{
73 Group: "objs",
74 Target: Object{
75 Name: "kernelchaos",
76 Object: &v1alpha1.KernelChaos{},
77 },
78 },
79
80 fx.Annotated{
81 Group: "objs",
82 Target: Object{
83 Name: "jvmchaos",
84 Object: &v1alpha1.JVMChaos{},
85 },
86 },
87
88 fx.Annotated{
89 Group: "objs",
90 Target: Object{
91 Name: "networkchaos",
92 Object: &v1alpha1.NetworkChaos{},
93 },
94 },
95
96 fx.Annotated{
97 Group: "objs",
98 Target: Object{
99 Name: "podchaos",
100 Object: &v1alpha1.PodChaos{},
101 },
102 },
103
104 fx.Annotated{
105 Group: "objs",
106 Target: Object{
107 Name: "stresschaos",
108 Object: &v1alpha1.StressChaos{},
109 },
110 },
111
112 fx.Annotated{
113 Group: "objs",
114 Target: Object{
115 Name: "timechaos",
116 Object: &v1alpha1.TimeChaos{},
117 },
118 },
119
120 fx.Annotated{
121 Group: "objs",
122 Target: Object{
123 Name: "gcpchaos",
124 Object: &v1alpha1.GCPChaos{},
125 },
126 },
127
128 fx.Annotated{
129 Group: "objs",
130 Target: Object{
131 Name: "physicalmachinechaos",
132 Object: &v1alpha1.PhysicalMachineChaos{},
133 },
134 },
135
136 fx.Annotated{
137 Group: "objs",
138 Target: Object{
139 Name: "azurechaos",
140 Object: &v1alpha1.AzureChaos{},
141 },
142 },
143
144 fx.Annotated{
145 Group: "objs",
146 Target: Object{
147 Name: "blockchaos",
148 Object: &v1alpha1.BlockChaos{},
149 },
150 },
151 )
152
153
154 type WebhookObject struct {
155
156 Object v1alpha1.WebhookObject
157
158
159 Name string
160 }
161
162
163
164 var WebhookObjects = fx.Supply(
165 fx.Annotated{
166 Group: "webhookObjs",
167 Target: WebhookObject{
168 Name: "physicalmachine",
169 Object: &v1alpha1.PhysicalMachine{},
170 },
171 },
172 fx.Annotated{
173 Group: "webhookObjs",
174 Target: WebhookObject{
175 Name: "statuscheck",
176 Object: &v1alpha1.StatusCheck{},
177 },
178 },
179 )
180