在 Golang 应用程序中使用 Couchbase Lite(而不是 Couchbase Server)

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

Using Couchbase Lite (not Couchbase Server) in a Golang application

问题

我想知道是否有人尝试在 Golang 应用程序中使用 Couchbase Lite(而不是 Couchbase Server)。换句话说,将其构建为 Golang 二进制文件?

我找到了这个库 Couchbase Lite Core,通过快速阅读,它看起来是 Couchbase Lite 的底层库(我可能理解有误)?但我找不到如何使用它。

有人尝试过使用类似 cgo 的方法使其工作吗?我希望将其静态构建到应用程序中,这样在分发时就没有依赖性。

英文:

I'm wondering if anyone has ever tried to use Couchbase Lite (not Couchbase Server) in a Golang application. In other words building it into a Golang binary?

I came across this library Couchbase Lite Core and through a quick read, it looks like the underlying library for Couchbase Lite (I stand corrected)? What I couldn't find though was how to use it.

Has anyone tried to make this work with something like cgo perhaps? I'm looking to build it statically into the application so it doesn't have dependencies when distributed.

答案1

得分: 1

Lite Core是即将推出的Couchbase Lite 2.0版本的底层实现。它目前仍在开发中。其意图是在顶部具有特定于平台和语言的绑定的共同核心。

据我所知,目前还没有Go的实现。cgo看起来是一个选择。考虑到Lite Core的目标是成为所有平台的底层实现,这似乎是一个合理的方法。

如果您有兴趣,可以在https://github.com/couchbaselabs上找到社区项目的GitHub帐户。如果您在此上面工作,将其包含在其中将是很好的。

要查看平台集成的示例,请查看https://github.com/couchbase/couchbase-lite-ios/tree/feature/2.0

英文:

Lite Core is the underlying implementation of the upcoming 2.0 version of Couchbase Lite. It's still under development. The intention is to have a common core, with platform and language specific bindings on top.

There is currently no Go implementation I'm aware of. cgo does look like an option. Given the goal of Lite Core being the underlying implementation for all platforms, this seems on its face like a reasonable approach.

If you're interested, there's a GitHub account for community projects at https://github.com/couchbaselabs. If you work on this, it would be great to have it included there.

To see an example of platform integration, take a look at https://github.com/couchbase/couchbase-lite-ios/tree/feature/2.0

答案2

得分: 0

我还没有尝试过嵌入式的Couchbase Lite,但是我和我的团队经常使用像BoltDB这样的嵌入式数据存储。假设你没有大量使用Couchbase的复制功能,BoltDB可能符合你的需求。

英文:

I haven't tried embedding Couchbase Lite, but my team and I make extensive use of embedded datastores like BoltDB Assuming you aren't using Couchbase's replication features heavily, BoltDB may meet your requirements.

huangapple
  • 本文由 发表于 2017年8月22日 21:07:07
  • 转载请务必保留本文链接:https://go.coder-hub.com/45818544.html
匿名

发表评论

匿名网友

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

确定