This repository provides a sample Go plugin for Tyk.
The project implements a simple middleware for header injection (MyPreHook), using a Pre hook (see Tyk custom middleware hooks). An authentication hook is also provided (MyAuthCheck), see hooks.go.
Go compiler.
After checking the requirements, clone this repository:
$ git clone https://github.com/TykTechnologies/tyk-plugin-demo-golang.git
Enter the plugin directory:
$ cd tyk-plugin-demo-golang
Go plugins are delivered as plugin bundles. The manifest file (manifest.json
) contains the custom middleware definition.
$ tyk-cli bundle build
You may check the tyk-cli documentation for additional options.