File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -1048,7 +1048,6 @@ func ConfigDigest(cdyfile Input) ([64]byte, error) {
1048
1048
if err != nil {
1049
1049
return [64 ]byte {}, err
1050
1050
}
1051
-
1052
1051
sblocksJson , err := json .Marshal (sblocks )
1053
1052
if err != nil {
1054
1053
return [64 ]byte {}, err
Original file line number Diff line number Diff line change @@ -271,6 +271,15 @@ func RegisterEventHook(name string, hook EventHook) {
271
271
}
272
272
}
273
273
274
+ // RegisterOrUpdateEventHook plugs in hook. All the hooks should register themselves
275
+ // and they must have a name.
276
+ func RegisterOrUpdateEventHook (name string , hook EventHook ) {
277
+ if name == "" {
278
+ panic ("event hook must have a name" )
279
+ }
280
+ eventHooks .Store (name , hook )
281
+ }
282
+
274
283
// EmitEvent executes the different hooks passing the EventType as an
275
284
// argument. This is a blocking function. Hook developers should
276
285
// use 'go' keyword if they don't want to block Caddy.
You can’t perform that action at this time.
0 commit comments