You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The truss generated gokit service should have imports utilizing the .pb.go files referenced in
the .proto imports.
Primary Use Case
The ability to proxy messages through one service to another. In the definitions supplied above,
the Threader service needs to accept a Post message from the post.proto definition which it will ultimately use in some call to the Poster service itself (perhaps to UpdatePost).
You could replicate the messages across service definitions, but that creates more problems
than it solves. Most notable of which is, simply, future maintenance (e.g. updating a message
requires updating every copy of it in related services). Type mismatches are also a fairly
significant problem as mapping functions between copies of message structs will be required to
work with other service clients.
Considerations
What if the .pb.go files are actually generated in a directory away from the .proto file?
Is the expected workflow acceptable? E.g. making sure you keep depended-on services up to date and built locally.
You could simply put shared messages in a shared folder/repo and reference those from all services that need them. This seems like it might not be a great developer experience though.
The text was updated successfully, but these errors were encountered:
Would be interested in helping to make this a reality at some point also, let me know if there's anything I can do to assist or if there is a clear path forward on implementation!
Suppose you have a
.proto
file that contains animport
sourcing another service definition:Dependent service definition
Standalone service definition
Shared messages
The truss generated gokit service should have imports utilizing the
.pb.go
files referenced inthe
.proto
imports.Primary Use Case
The ability to proxy messages through one service to another. In the definitions supplied above,
the
Threader
service needs to accept aPost
message from thepost.proto
definition which it will ultimately use in some call to thePoster
service itself (perhaps toUpdatePost
).You could replicate the messages across service definitions, but that creates more problems
than it solves. Most notable of which is, simply, future maintenance (e.g. updating a message
requires updating every copy of it in related services). Type mismatches are also a fairly
significant problem as mapping functions between copies of message structs will be required to
work with other service clients.
Considerations
.pb.go
files are actually generated in a directory away from the.proto
file?The text was updated successfully, but these errors were encountered: