@@ -59,12 +59,12 @@ func (h *CreateLambdaHandler) Typ() string {
59
59
}
60
60
61
61
// Check .
62
- func (h * CreateLambdaHandler ) Check (context.Context , interface {} ) (bool , error ) {
62
+ func (h * CreateLambdaHandler ) Check (context.Context , any ) (bool , error ) {
63
63
return true , nil
64
64
}
65
65
66
66
// Encode .
67
- func (h * CreateLambdaHandler ) Encode (raw interface {} ) ([]byte , error ) {
67
+ func (h * CreateLambdaHandler ) Encode (raw any ) ([]byte , error ) {
68
68
workloadID , ok := raw .(string )
69
69
if ! ok {
70
70
return nil , errors .Wrapf (types .ErrInvalidWALDataType , "%+v" , raw )
@@ -73,12 +73,12 @@ func (h *CreateLambdaHandler) Encode(raw interface{}) ([]byte, error) {
73
73
}
74
74
75
75
// Decode .
76
- func (h * CreateLambdaHandler ) Decode (bs []byte ) (interface {} , error ) {
76
+ func (h * CreateLambdaHandler ) Decode (bs []byte ) (any , error ) {
77
77
return string (bs ), nil
78
78
}
79
79
80
80
// Handle .
81
- func (h * CreateLambdaHandler ) Handle (ctx context.Context , raw interface {} ) error {
81
+ func (h * CreateLambdaHandler ) Handle (ctx context.Context , raw any ) error {
82
82
workloadID , ok := raw .(string )
83
83
if ! ok {
84
84
return errors .Wrapf (types .ErrInvalidWALDataType , "%+v" , raw )
@@ -133,7 +133,7 @@ func (h *CreateWorkloadHandler) Typ() string {
133
133
}
134
134
135
135
// Check .
136
- func (h * CreateWorkloadHandler ) Check (_ context.Context , raw interface {} ) (handle bool , err error ) {
136
+ func (h * CreateWorkloadHandler ) Check (_ context.Context , raw any ) (handle bool , err error ) {
137
137
_ , ok := raw .(* types.Workload )
138
138
if ! ok {
139
139
return false , errors .Wrapf (types .ErrInvalidWALDataType , "%+v" , raw )
@@ -142,7 +142,7 @@ func (h *CreateWorkloadHandler) Check(_ context.Context, raw interface{}) (handl
142
142
}
143
143
144
144
// Encode .
145
- func (h * CreateWorkloadHandler ) Encode (raw interface {} ) ([]byte , error ) {
145
+ func (h * CreateWorkloadHandler ) Encode (raw any ) ([]byte , error ) {
146
146
wrk , ok := raw .(* types.Workload )
147
147
if ! ok {
148
148
return nil , errors .Wrapf (types .ErrInvalidWALDataType , "%+v" , raw )
@@ -151,14 +151,14 @@ func (h *CreateWorkloadHandler) Encode(raw interface{}) ([]byte, error) {
151
151
}
152
152
153
153
// Decode .
154
- func (h * CreateWorkloadHandler ) Decode (bs []byte ) (interface {} , error ) {
154
+ func (h * CreateWorkloadHandler ) Decode (bs []byte ) (any , error ) {
155
155
wrk := & types.Workload {}
156
156
err := json .Unmarshal (bs , wrk )
157
157
return wrk , err
158
158
}
159
159
160
160
// Handle will remove instance, remove meta, restore resource
161
- func (h * CreateWorkloadHandler ) Handle (ctx context.Context , raw interface {} ) (err error ) {
161
+ func (h * CreateWorkloadHandler ) Handle (ctx context.Context , raw any ) (err error ) {
162
162
wrk , _ := raw .(* types.Workload )
163
163
logger := log .WithFunc ("wal.CreateWorkloadHandler.Handle" ).WithField ("ID" , wrk .ID ).WithField ("node" , wrk .Nodename )
164
164
@@ -210,15 +210,15 @@ func (h *WorkloadResourceAllocatedHandler) Typ() string {
210
210
}
211
211
212
212
// Check .
213
- func (h * WorkloadResourceAllocatedHandler ) Check (_ context.Context , raw interface {} ) (bool , error ) {
213
+ func (h * WorkloadResourceAllocatedHandler ) Check (_ context.Context , raw any ) (bool , error ) {
214
214
if _ , ok := raw .([]* types.Node ); ! ok {
215
215
return false , errors .Wrapf (types .ErrInvalidWALDataType , "%+v" , raw )
216
216
}
217
217
return true , nil
218
218
}
219
219
220
220
// Encode .
221
- func (h * WorkloadResourceAllocatedHandler ) Encode (raw interface {} ) ([]byte , error ) {
221
+ func (h * WorkloadResourceAllocatedHandler ) Encode (raw any ) ([]byte , error ) {
222
222
nodes , ok := raw .([]* types.Node )
223
223
if ! ok {
224
224
return nil , errors .Wrapf (types .ErrInvalidWALDataType , "%+v" , raw )
@@ -227,13 +227,13 @@ func (h *WorkloadResourceAllocatedHandler) Encode(raw interface{}) ([]byte, erro
227
227
}
228
228
229
229
// Decode .
230
- func (h * WorkloadResourceAllocatedHandler ) Decode (bytes []byte ) (interface {} , error ) {
230
+ func (h * WorkloadResourceAllocatedHandler ) Decode (bytes []byte ) (any , error ) {
231
231
nodes := []* types.Node {}
232
232
return nodes , json .Unmarshal (bytes , & nodes )
233
233
}
234
234
235
235
// Handle .
236
- func (h * WorkloadResourceAllocatedHandler ) Handle (ctx context.Context , raw interface {} ) (err error ) {
236
+ func (h * WorkloadResourceAllocatedHandler ) Handle (ctx context.Context , raw any ) (err error ) {
237
237
nodes , _ := raw .([]* types.Node )
238
238
logger := log .WithFunc ("wal.WorkloadResourceAllocatedHandler.Handle" ).WithField ("event" , eventWorkloadResourceAllocated )
239
239
@@ -281,15 +281,15 @@ func (h *ProcessingCreatedHandler) Typ() string {
281
281
}
282
282
283
283
// Check .
284
- func (h ProcessingCreatedHandler ) Check (_ context.Context , raw interface {} ) (bool , error ) {
284
+ func (h ProcessingCreatedHandler ) Check (_ context.Context , raw any ) (bool , error ) {
285
285
if _ , ok := raw .(* types.Processing ); ! ok {
286
286
return false , errors .Wrapf (types .ErrInvalidWALDataType , "%+v" , raw )
287
287
}
288
288
return true , nil
289
289
}
290
290
291
291
// Encode .
292
- func (h * ProcessingCreatedHandler ) Encode (raw interface {} ) ([]byte , error ) {
292
+ func (h * ProcessingCreatedHandler ) Encode (raw any ) ([]byte , error ) {
293
293
processing , ok := raw .(* types.Processing )
294
294
if ! ok {
295
295
return nil , errors .Wrapf (types .ErrInvalidWALDataType , "%+v" , raw )
@@ -298,13 +298,13 @@ func (h *ProcessingCreatedHandler) Encode(raw interface{}) ([]byte, error) {
298
298
}
299
299
300
300
// Decode .
301
- func (h * ProcessingCreatedHandler ) Decode (bs []byte ) (interface {} , error ) {
301
+ func (h * ProcessingCreatedHandler ) Decode (bs []byte ) (any , error ) {
302
302
processing := & types.Processing {}
303
303
return processing , json .Unmarshal (bs , processing )
304
304
}
305
305
306
306
// Handle .
307
- func (h * ProcessingCreatedHandler ) Handle (ctx context.Context , raw interface {} ) (err error ) {
307
+ func (h * ProcessingCreatedHandler ) Handle (ctx context.Context , raw any ) (err error ) {
308
308
processing , _ := raw .(* types.Processing )
309
309
logger := log .WithFunc ("wal.ProcessingCreatedHandler.Handle" ).WithField ("event" , eventProcessingCreated ).WithField ("ident" , processing .Ident )
310
310
0 commit comments