2EXP / apisix-plugin-template

Simple template to get started with custom Apache APISIX plugins

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

apisix-plugin-demo

Build Status

This repository contains a basic Apache APISIX plugin template to help you get started with Apache APISIX plugin development.

This template was designed to work with the GitHub Action development environments.

Table of contents

Getting Started

Before we dive into plugin development and everything related to it, a brief look at the GitHub Template is in order

All you need to do is click the Use this template button (you must be logged in with your GitHub account).

After using the template to create your own blank custom plugin project, the project is ready to be cloned to your local environment and development.

Back to TOC

Plugin template structure

.
├── .github/         GitHub Actions workflows and Dependabot configuration files
├── apisix           All files in this folder will be copied and overwrite the original APISIX
│   └── plugins/     Plugin source
├── ci               All files in this folder will be copied and overwrite the original APISIX
│   └── utils/       CI utils script folder
├── t/               Test case folder
├── LICENSE
├── Makefile
└── README.md        README

Back to TOC

Sample Code

The prepared plugin template provides as little code as possible because it is impossible for a general scaffold to fulfill all the specific requirements for all types of plugins. Therefore, the template contains only the following files:

.
├── apisix
│   └── plugins/
│       └── demo.lua
└── t
    └── demo/
        └── demo.t      

To start with the actual implementation, you may check our APISIX Plugin Deveolpment, which contains an introduction to the essential parts of the plugin development.

Back to TOC

Testing

Testing plugins is an essential part of the plugin development to make sure that everything works as expected.

Continuous integration

Continuous integration (CI) depends on GitHub Actions, a set of workflows that make it possible to automate your testing process. Thanks to such automation, you can delegate the testing and verification phases to the CI and instead focus on development (and writing more tests).

In the .github/workflows directory, you can find definitions for the following GitHub Actions workflows:

  • CI
    • Triggered on push and pull_request events.
    • Run test case in t folder

Back to TOC

Useful links

Back to TOC

About

Simple template to get started with custom Apache APISIX plugins

License:Apache License 2.0


Languages

Language:Perl 28.5%Language:Shell 26.7%Language:Makefile 22.4%Language:Lua 22.4%