go-capnp icon indicating copy to clipboard operation
go-capnp copied to clipboard

Import of external capnp files without Go imports

Open enugentdt opened this issue 5 years ago • 1 comments

Hello,

This may be a bit of a thinking out loud, but here's my general question. It's also possible that I just didn't read the documentation well enough, so please feel free to point me in the right direction if there is already an answer for this.

Say I have a capnp definition from someone else - some standard file that is all of the types, interfaces, etc., that would be used in a set of APIs. Would it make sense for this tool & library to be able to take a capnp file, have other files imported, and have those other files not need Go package & import definitions? I.e. pull types from other files and almost have them added "inline," or something of that style.

For context, I'm working on a set of microservices that all need to communicate on the same API. For me, it's a pain if I have to create different variants of the same data for every language I use.

However, I'm also relatively new to CapNProto, so it's 100% possible I'm misunderstanding the point.

Thanks in advance!

enugentdt avatar Apr 11 '19 01:04 enugentdt

Related, we've talked in the past about having the code generator try to infer package names & import paths, see e.g:

https://github.com/capnproto/go-capnproto2/issues/47

zenhack avatar Apr 11 '19 04:04 zenhack