PDK
As of this release, the PDK has not yet reached 1.0.0, but plugin authors can already depend on it for a safe and reliable way of interacting with the request, response, or the core components.
The Plugin Development Kit is accessible from the global variable, and various functionalities are namespaced under this table, such as kong.request
, kong.log
, etc…
A human-readable string containing the version number of the currently running node.
Usage
kong.version_num
An integral number representing the version number of the currently running node, useful for comparison and feature-existence checks.
Usage
end
kong.pdk_major_version
A number representing the major version of the current PDK (e.g. 1
). Useful for feature-existence checks or backwards-compatible behavior as users of the PDK.
Usage
Usage
print(kong.pdk_version) -- "1.0.0"
kong.configuration
A read-only table containing the configuration of the current Kong node, based on the configuration file and environment variables.
See for details.
Comma-separated lists in that file get promoted to arrays of strings in this table.
Usage
kong.db
Instance of Kong’s DAO (the module). Contains accessor objects to various entities.
A more thorough documentation of this DAO and new schema definitions is to be made available in the future.
Usage
kong.db.services:insert()
kong.db.routes:select()
Note: usage of this module is currently reserved to the core or to advanced users.
kong.worker_events
Instance of Kong’s IPC module for inter-workers communication from the module.
Note: usage of this module is currently reserved to the core or to advanced users.
kong.cluster_events
Instance of Kong’s cluster events module for inter-nodes communication.
Note: usage of this module is currently reserved to the core or to advanced users.
Instance of Kong’s database caching object, from the kong.cache
module.
Note: usage of this module is currently reserved to the core or to advanced users.