Native Golang Middleware


#1

github.com/TykTechnologies/tyk/blob/master/middleware_sample.go

Is there any documentation on how to get native golang middleware to work? Everything I’ve see so far has to do with Javascript.

Thanks,

JO


#2

You need to write it and compile it into a custom build.

Once you’ve implemented the interface, you just register it in the pipeline and build tyk:


#3

For reasons of speed I’m looking for a way to use native golang virtual endpoint instead of the javascript? Is this possible?


#4

Yes, but you need to fork and recompile core. It’s also not very flexible. Golang isn’t a dynamically linked language so all changes must be baked into the gateway, it’s petty extreme.

I’d stick with the JS or find another way to do what you are trying to achieve.