Giter Site home page Giter Site logo

How to use these plugins? about go-plugins HOT 12 CLOSED

kong avatar kong commented on September 27, 2024
How to use these plugins?

from go-plugins.

Comments (12)

jainrocks avatar jainrocks commented on September 27, 2024 1

I didn't install or set any path for go in my Amazon linux instance, where kong is running.
Okay, will check for this.
Thanks a lot @gszr

from go-plugins.

gszr avatar gszr commented on September 27, 2024

Hi @jainrocks,

Thanks for posting this question!

Additionally to passing the go_plugins_dir directive (which simply tells the go-pluginserver where to find Go plugins), you need to enable the Go plugin - as with any custom Kong plugin. See this.

So, do something like

go_plugins_dir = /usr/local/kong/goplugins
plugins = bundled,go-hello

from go-plugins.

jainrocks avatar jainrocks commented on September 27, 2024

Hi @gszr,
Thank you so much for the quick reply. I am getting this:

Kong stopped Error: /usr/local/share/lua/5.1/kong/cmd/start.lua:64: 2020/06/10 15:03:09 stat /usr/local/kong/goplugins/go-hello.so: no such file or directory nginx: [error] init_by_lua error: /usr/local/share/lua/5.1/kong/db/dao/plugins/go.lua:455: bad argument #1 to 'ipairs' (table expected, got nil) stack traceback: [C]: in function 'ipairs' /usr/local/share/lua/5.1/kong/db/dao/plugins/go.lua:455: in function 'get_plugin' /usr/local/share/lua/5.1/kong/db/dao/plugins/go.lua:481: in function 'load_plugin' /usr/local/share/lua/5.1/kong/db/dao/plugins.lua:151: in function 'load_plugin_handler' /usr/local/share/lua/5.1/kong/db/dao/plugins.lua:227: in function 'load_plugin' /usr/local/share/lua/5.1/kong/db/dao/plugins.lua:275: in function 'load_plugin_schemas' /usr/local/share/lua/5.1/kong/init.lua:427: in function 'init' init_by_lua:3: in main chunk
I am new to go language, please help.

from go-plugins.

gszr avatar gszr commented on September 27, 2024

@jackkav did you compile the Go plugin? Take a look at the makefile in this repo.

from go-plugins.

jainrocks avatar jainrocks commented on September 27, 2024

@gszr
No I didn't compile earlier. My bad.
I tried compiling now using make
I get:

go build -buildmode=plugin go-hello.go
make: go: Command not found
make: *** [go-hello.so] Error 127

from go-plugins.

gszr avatar gszr commented on September 27, 2024

From the error, it looks like you either don't have a Go compiler installed -- or it isn't in the PATH.

from go-plugins.

jainrocks avatar jainrocks commented on September 27, 2024

@gszr
Still getting the above issue.
After installing the go and setting the path.
go env is gibing the below result
GO111MODULE="" GOARCH="amd64" GOBIN="" GOCACHE="/home/ec2-user/.cache/go-build" GOENV="/home/ec2-user/.config/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GONOPROXY="" GONOSUMDB="" GOOS="linux" GOPATH="/home/ec2-user/go" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/usr/local/go" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64" GCCGO="gccgo" AR="ar" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="/usr/local/kong/goplugins/go.mod" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build005273170=/tmp/go-build -gno-record-gcc-switches"
But still getting the above issue.

from go-plugins.

gszr avatar gszr commented on September 27, 2024

@jainrocks please post the entire output - in the same terminal you ran the go env.

from go-plugins.

jainrocks avatar jainrocks commented on September 27, 2024

@gszr
Below is the output for the same.

Screenshot 2020-06-11 at 8 20 40 AM

from go-plugins.

jainrocks avatar jainrocks commented on September 27, 2024

@gszr Please help here.

from go-plugins.

gszr avatar gszr commented on September 27, 2024

@jainrocks note that you are doing sudo make, while the commands before printed the environment for the current user, not root. Try make, without sudo.

from go-plugins.

gszr avatar gszr commented on September 27, 2024

Closing this as resolved. Please post an update if you still need help. Thanks!

from go-plugins.

Related Issues (13)

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.