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) {
10481048 if err != nil {
10491049 return [64 ]byte {}, err
10501050 }
1051-
10521051 sblocksJson , err := json .Marshal (sblocks )
10531052 if err != nil {
10541053 return [64 ]byte {}, err
Original file line number Diff line number Diff line change @@ -271,6 +271,15 @@ func RegisterEventHook(name string, hook EventHook) {
271271 }
272272}
273273
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+
274283// EmitEvent executes the different hooks passing the EventType as an
275284// argument. This is a blocking function. Hook developers should
276285// use 'go' keyword if they don't want to block Caddy.
You can’t perform that action at this time.
0 commit comments