golang的GT.M数据库包

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

golang package for GT.M database

问题

有没有现成的 Golang 包可以用来访问 GT.M 数据库?

例如,有一个名为 mgo 的包,用于处理 Go 语言中的 MongoDB。类似地,couchgomaster 包用于访问 Go 语言中的 CouchDB。

我需要通过 Go 语言访问 GT.M 数据库。

英文:

Is there any golang package already available to access GT.M database?

For example there is a package named mgo which is used to handle mongoDb
in go language. Similarly couchgomaster package is used to access couchDb
in go language.

I need to access GT.M database through go language.

答案1

得分: 7

我所知道的,FIS GT.M(http://fis-gtm.com)和Go之间目前没有现成的绑定。

然而,将GT.M与任何其他可以进行C兼容调用的语言进行接口连接是很简单的。由于我不了解Go,我将以C的术语回答,并请您相应地进行调整。要从C调用GT.M,首先在GT.M中创建您首选的API,然后创建一个调用表文件(一个将C函数名映射到GT.M函数名的文本文件)。要从GT.M调用C,创建C函数并将其编译为共享库,并创建调用表。您可以在GT.M程序员指南UNIX版第11章(集成外部例程)中找到可下载的示例。[有关所有GT.M用户文档,请转到GT.M主页,然后单击“用户文档”选项卡。]

如果您对Java比对C更熟悉,您可以使用GTMJI(转到http://sourceforge.net/projects/fis-gtm/files/Plugins/GTMJI/并获取最新版本),它提供了GT.M和Java之间的调用。GTMJI的文档位于GT.M用户文档页面上。

虽然GTMJI是由GT.M开发团队开发的,但您可以使用/模拟第三方绑定,包括node.js、Python(请参阅OSEHRAPyPI)、RubyPerl。虽然我个人了解GT.M和GTMJI(我是GT.M团队的一员),但我对第三方绑定了解较少,尽管我知道node.js绑定在日常生产中使用。

如果您有更多问题,请随时提问。

英文:

There is not an existing binding between FIS GT.M (http://fis-gtm.com) and Go that I know of.

However, interfacing GT.M to any other language that can make C compatible calls is straightforward. Since I don't know Go, I'll answer in terms of C and you can adjust accordingly. To call from C to GT.M, create your preferred API in GT.M, create a file with the call-in table (a text file mapping C function names to GT.M function names). To call from GT.M to C, create C functions to call & compile them into a shared library, and create the call-out table. The GT.M Programmers Guide UNIX Edition Chapter 11 (Integrating External Routines) has examples you can download. [For all GT.M user documentation, go to the GT.M home page and click on the User Documentation tab.]

If you're more comfortable with Java than with C, you can use GTMJI (go to
http://sourceforge.net/projects/fis-gtm/files/Plugins/GTMJI/ and get the latest version), which provides call-ins between GT.M and Java. Documentation for GTMJI is on the GT.M user documentation page.

While GTMJI is developed by the GT.M development team, there are third party bindings that you can use / model, including node.js, Python (see OSEHRA and PyPI), Ruby, and Perl. While I know GT.M and GTMJI personally (I am part of the GT.M team), I know less about the third party bindings, although I do know that the node.js binding is in daily production use.

If you have further questions, please do ask.

答案2

得分: 0

不,Greystone Technology M似乎没有任何公开的Go项目。

go-search查询(gtmgreystone)没有返回任何相关内容。

英文:

No: the Greystone Technology M doesn't seem to have any public go project.

The go-search queries (for gtm or for greystone) don't return anything relevant.

答案3

得分: 0

这是有关使用Go与C进行本地接口的更多信息。

http://www.goinggo.net/2013/08/using-c-dynamic-libraries-in-go-programs.html

我相信你可以编写一个包含所需函数的小型C程序,例如gtm_init()、gtm_set()、gtm_get()、gtm_del()等,然后使用CGO进行接口调用。

英文:

Here is more info on interfacing natively with Go to C.

http://www.goinggo.net/2013/08/using-c-dynamic-libraries-in-go-programs.html

I believe you can write a little c program with required functions: gtm_init(), gtm_set(), gtm_get(), gtm_del() etc. and then interface with CGO

huangapple
  • 本文由 发表于 2014年9月11日 17:05:34
  • 转载请务必保留本文链接:https://go.coder-hub.com/25783340.html
匿名

发表评论

匿名网友

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

确定