Coder Social home page Coder Social logo

kong-plugin's Introduction

Unix build Luacheck

Kong plugin template

This repository contains a very simple Kong plugin template to get you up and running quickly for developing your own plugins.

This template was designed to work with the kong-pongo and kong-vagrant development environments.

Please check out those repos README files for usage instructions. For a complete walkthrough check this blogpost on the Kong website.

Naming and versioning conventions

There are a number "named" components and related versions. These are the conventions:

  • Kong plugin name: This is the name of the plugin as it is shown in the Kong Manager GUI, and the name used in the file system. A plugin named my-cool-plugin would have a handler.lua file at ./kong/plugins/my-cool-plugin/handler.lua.

  • Kong plugin version: This is the version of the plugin code, expressed in x.y.z format (using Semantic Versioning is recommended). This version should be set in the handler.lua file as the VERSION property on the plugin table.

  • LuaRocks package name: This is the name used in the LuaRocks eco system. By convention this is kong-plugin-[KongPluginName]. This name is used for the rockspec file, both in the filename as well as in the contents (LuaRocks requires that they match).

  • LuaRocks package version: This is the version of the package, and by convention it should be identical to the Kong plugin version. As with the LuaRocks package name the version is used in the rockspec file, both in the filename as well as in the contents (LuaRocks requires that they match).

  • LuaRocks rockspec revision: This is the revision of the rockspec, and it only changes if the rockspec is updated. So when the source code remains the same, but build instructions change for example. When there is a new LuaRocks package version the LuaRocks rockspec revision is reset to 1. As with the LuaRocks package name the revision is used in the rockspec file, both in the filename as well as in the contents (LuaRocks requires that they match).

  • LuaRocks rockspec name: this is the filename of the rockspec. This is the file that contains the meta-data and build instructions for the LuaRocks package. The filename is [package name]-[package version]-[package revision].rockspec.

Example

  • Kong plugin name: my-cool-plugin

  • Kong plugin version: 1.4.2 (set in the VERSION field inside handler.lua)

This results in:

  • LuaRocks package name: kong-plugin-my-cool-plugin

  • LuaRocks package version: 1.4.2

  • LuaRocks rockspec revision: 1

  • rockspec file: kong-plugin-my-cool-plugin-1.4.2-1.rockspec

  • File handler.lua is located at: ./kong/plugins/my-cool-plugin/handler.lua (and similar for the other plugin files)

kong-plugin's People

Contributors

tieske avatar samugi avatar curiositycasualty avatar baokong avatar gszr avatar hanshuebner avatar team-eng-enablement avatar techievena avatar sjpuas avatar jammm avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.