Skip to content

Latest commit

 

History

History
36 lines (21 loc) · 971 Bytes

README.md

File metadata and controls

36 lines (21 loc) · 971 Bytes

Go plugin

Plugin overview

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.

Requirements

Go compiler.

Instructions

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

Building a bundle

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.