Metadata-Version: 2.1
Name: kong_pdk
Version: 0.23
Summary: Kong PDK for Python and Plugin Server
Home-page: https://github.com/fffonion/kong-python-pdk
Author: fffonion
Author-email: fffonion@gmail.com
License: Apache-2.0
Description: # kong-python-pluginserver
        
        [![PyPI version](https://badge.fury.io/py/kong-pdk.svg)](https://badge.fury.io/py/kong-pdk)
        
        Plugin server and PDK (Plugin Development Kit) for Python language support in Kong.
        
        Requires Kong >= 2.3.0.
        
        ## Install the plugin server
        
        ```shell
        pip3 install kong-pdk
        ```
        
        ## Usage
        
        ```
        usage: kong-pluginserver.py [-h] [-p prefix] [-v] [--version]
                                    [--socket-name SOCKET_NAME] [-m | -g] -d directory
                                    [--dump-plugin-info name] [--dump-all-plugins]
        
        Kong Python Plugin Server.
        
        optional arguments:
          -h, --help            show this help message and exit
          -p prefix, --kong-prefix prefix, -kong-prefix prefix
                                unix domain socket path to listen
          -v, --verbose         turn on verbose logging
          --version, -version   show program's version number and exit
          --socket-name SOCKET_NAME
                                socket name to listen on
          -m, --multiprocessing
                                enable multiprocessing
          -g, --gevent          enable gevent
          -d directory, --plugins-directory directory, -plugins-directory directory
                                plugins directory
          --dump-plugin-info name, -dump-plugin-info name
                                dump specific plugin info into stdout
          --dump-all-plugins, -dump-all-plugins
                                dump all plugins info into stdout
        ```
        
        ## Configure Kong
        
        Add the following line into `kong.conf`:
        
        ```
        plugins=bundled,py-hello,py-image
        pluginserver_names=go, py
        pluginserver_py_socket=/usr/local/kong/python_pluginserver.sock
        pluginserver_py_start_cmd=/usr/local/bin/kong-python-pluginserver -d /dir/to/kong-python-pdk/examples
        pluginserver_py_query_cmd=/usr/local/bin/kong-python-pluginserver -d /dir/to/kong-python-pdk/examples --dump-all-plugins
        ```
        
        For example, to test examples, clone `kong-python-pdk` to `/dir/to/kong-python-pdk`.
        
        To use seperate instance for each plugin, use:
        
        ```
        plugins=bundled,py-hello,py-image
        pluginserver_names=go, py-hello, py-image
        
        pluginserver_py_hello_socket=/usr/local/kong/py_hello.sock
        pluginserver_py_hello_start_cmd=/dir/to/kong-python-pdk/examples/py-hello.py
        pluginserver_py_hello_query_cmd=/dir/to/kong-python-pdk/examples/py-hello.py -d
        
        pluginserver_py_image_socket=/usr/local/kong/py_image.sock
        pluginserver_py_image_start_cmd=/dir/to/kong-python-pdk/examples/py-image.py
        pluginserver_py_image_query_cmd=/dir/to/kong-python-pdk/examples/py-image.py -d
        ```
        
        ## Enable the plugin
        
        Same step as it's a Lua plugin.
        
        ## Notes
        
        - All PDK API supported by Go Plugin Server is supported.
        - If your plugins are CPU intensive, consider using multiprocessing mode (`-m` flag) or run the plugin instance in a seperate process (examples/py-hello.py as an example) to distribute workloads to multicore.
        - If your plugins are I/O intensive, considering using gevent mode (`-g` flag) and use gevent libraries in the plugin.
        
        
        ## TODO
        
        - Tests
        - Hot reload
        
        
        <a name="unreleased"></a>
        ## [Unreleased]
        
        
        <a name="0.2.2"></a>
        ## [0.2.2] - 2021-03-29
        ### feat
        - add typed interfaces [f98e44d](https://github.com/Kong/kong-python-pdk/commit/f98e44d75271d5daceaf00f8f011ce7efaa19865)
        
        ### fix
        - correct license in setup.py ([#3](https://github.com/Kong/kong-python-pdk/issues/3)) [b257c98](https://github.com/Kong/kong-python-pdk/commit/b257c98298343e2911de35d89dc44c1cb0f59547)
        - threading mode pipe and styles [6f73ac7](https://github.com/Kong/kong-python-pdk/commit/6f73ac76c6f3fc49081ba67b62e0d9ea4547cbb1)
        - enable plugin server without gevent mode [a29c4d7](https://github.com/Kong/kong-python-pdk/commit/a29c4d765fb9e2dfa1a8b27fccb333864a61d529)
        
        
        <a name="0.2.1"></a>
        ## [0.2.1] - 2021-02-24
        ### feat
        - set friendly process title [aa59083](https://github.com/Kong/kong-python-pdk/commit/aa59083e6ede0394fdf2cb25f9925a36a7cc5aae)
        - multiprocessing mode [1a97d26](https://github.com/Kong/kong-python-pdk/commit/1a97d26e773c399149f12bee08943821a3dd9c7b)
        
        ### fix
        - disable gevent in multiprocessing and make it optional [5b6fb68](https://github.com/Kong/kong-python-pdk/commit/5b6fb682d9237ebb75bc653c0536678f3efe7d67)
        - chmod+x on examples [1f5905d](https://github.com/Kong/kong-python-pdk/commit/1f5905dc879528c519411b2914e20e2b5236e749)
        
        
        <a name="0.2.0"></a>
        ## [0.2.0] - 2021-02-22
        ### feat
        - exit server if parent is dead [0ee2183](https://github.com/Kong/kong-python-pdk/commit/0ee2183c5679d9cc255435ff98c82d28fbf22f5b)
        - embed server in plugin [af55deb](https://github.com/Kong/kong-python-pdk/commit/af55deb6d2f65a8a2be654cd4c8d7f13247869ee)
        
        ### fix
        - sync with Kong 2.3 update [d42de7e](https://github.com/Kong/kong-python-pdk/commit/d42de7ef9565f316890aad3132e432e6a04c77f7)
        
        ### refactor
        - rename kong_pluginserver to kong_pdk [e802627](https://github.com/Kong/kong-python-pdk/commit/e802627436e4b856a16e4d68b9329914f2a3a4cc)
        
        
        <a name="0.1.2"></a>
        ## [0.1.2] - 2020-02-21
        ### fix
        - python2 compatibility [0e4cf1c](https://github.com/Kong/kong-python-pdk/commit/0e4cf1cda574db778e8152b30359e6e9927b0432)
        
        
        <a name="0.1.1"></a>
        ## [0.1.1] - 2020-02-20
        
        <a name="0.1.0"></a>
        ## 0.1.0 - 2020-01-03
        
        [Unreleased]: https://github.com/Kong/kong-python-pdk/compare/0.2.2...HEAD
        [0.2.2]: https://github.com/Kong/kong-python-pdk/compare/0.2.1...0.2.2
        [0.2.1]: https://github.com/Kong/kong-python-pdk/compare/0.2.0...0.2.1
        [0.2.0]: https://github.com/Kong/kong-python-pdk/compare/0.1.2...0.2.0
        [0.1.2]: https://github.com/Kong/kong-python-pdk/compare/0.1.1...0.1.2
        [0.1.1]: https://github.com/Kong/kong-python-pdk/compare/0.1.0...0.1.1
        
Platform: UNKNOWN
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: Implementation :: CPython
Requires: gevent
Requires: msgpack
Description-Content-Type: text/markdown
