Skip to content

Commit

Permalink
feat(hooks): add example config hook to template
Browse files Browse the repository at this point in the history
  • Loading branch information
Tieske committed Oct 28, 2024
1 parent a9ec908 commit c3acbb0
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions kong/plugins/myplugin/handler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,20 @@ function plugin:init_worker()
end --]]


---[[ Executed every time a plugin config changes.
-- This can run in the `init_worker` or `timer` phase.
-- @param configs table|nil A table with all the plugin configs of this plugin type.
function plugin:configure(configs)
kong.log.notice("saying hi from the 'configure' handler, got ", (configs and #configs or 0)," configs")

if configs == nil then
return -- no configs, nothing to do
end

-- your custom code here

end --]]


--[[ runs in the 'ssl_certificate_by_lua_block'
-- IMPORTANT: during the `certificate` phase neither `route`, `service`, nor `consumer`
Expand Down

0 comments on commit c3acbb0

Please sign in to comment.