有没有一种方法可以为Node.js创建Golang库的绑定?

huangapple go评论94阅读模式
英文:

Is there a way to create bindings for golang library for node.js?

问题

情况很简单:我有一个Node.js应用程序,希望它能够调用我用Go语言编写的网络库中的函数。据我所了解,Node.js中有许多用于封装C/C++代码的包装器,我能否创建一个用于封装我的Go语言库的包装器呢?

有一个名为gopy的工具(http://gopy.qur.me/extensions/install.html)可以解决Python的这个问题,但我找不到类似的工具适用于Node.js。

英文:

The situation is very simple: I have a node.js application and want it to be able to call functions from my networking library written in golang. As far as I understand there are numerous wrappers around c/c++ code in node, can I create a one around my golang library?

There is a tool gopy http://gopy.qur.me/extensions/install.html which solves this problem for python, but I was unable to found something similar for node.js

答案1

得分: 1

目前似乎无法在Golang中构建共享库。在golang repos中有一个讨论此问题的问题,还有一个描述go执行模式的文档。

关于这个问题的讨论可以参考https://stackoverflow.com/questions/6125683/call-go-functions-from-c。

英文:

It seems that it is not possible right now to build shared library in golang. There's an issue talking about this in golang repos and a document describing the go execution mode.

A discussion about this https://stackoverflow.com/questions/6125683/call-go-functions-from-c

huangapple
  • 本文由 发表于 2015年1月31日 21:03:21
  • 转载请务必保留本文链接:https://go.coder-hub.com/28251903.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定