A simple RPC framework with protobuf service definitions
APACHE-2.0 License
Bot releases are hidden (Show)
Published by marioizquierdo almost 6 years ago
A security vulnerability was discovered on the requirements.txt
file that is used to test Python-generated code, and could be used as sub-dependency checks for Python projects using Twirp.
Fix submitted in this PR: https://github.com/twitchtv/twirp/pull/137
Published by spenczar about 6 years ago
This release adds support for a new generator option, paths=source_relative
, to match the behavior of the official protoc-gen-go generator. That behavior is documented at https://github.com/golang/protobuf/pull/533.
Now, protoc-gen-twirp
can work outside of GOPATH to generate code. Files are output relative to where the proto source was found.
The change to make this possible is #126.
Published by spenczar about 6 years ago
This is a bug fix release. It fixes #123.
Previously, if a service had a method of the same name, the generated Go code would not compile. For example, generated code for this service would not compile:
service Echo {
rpc Echo(Msg) returns (Msg);
}
This was fixed in #124.
Published by spenczar over 6 years ago
This release includes two bug fixes.
First, there was a bug in import statement generation when multiple .proto
files were imported which shared an identical protobuf package, but which had different output go packages. This would most commonly occur when importing multiple "well-known type" definitions, like google/protobuf/empty.proto
and google/protobuf/wrappers.proto
. This was reported in #104, and fixed in #107.
Second, generated Go clients would previously return non-nil response types even when returning non-nil errors. This led to confusing behavior in some obscure cases, as users usually expect non-nil error
to imply a nil response. This was fixed in #105.
Published by spenczar over 6 years ago
This release includes #102, which adds support for flags for protoc-gen-twirp to map .proto
files to particular Go import paths. This was requested in #13.
Documentation is available in https://github.com/twitchtv/twirp/blob/2d98ac4d4ccb29e08ea745c758e6d103f971eba5/docs/command_line.md, which is (as of this release) on the doc website at https://twitchtv.github.io/twirp/docs/command_line.html.
Published by spenczar over 6 years ago
This release includes the following changes:
log
package under any circumstances. Previously, it would log in rare cases like when failing to write a complete error body back to clients or when failing to close request bodies. Now, those circumstances trigger an Error hook if it hasn't already been triggered once during handling of the request.Accept
header in requests. The JSON client sets application/json
, and the Protobuf client sets application/protobuf
. This should make generated clients work more smoothly with API gateways. Servers don't do any particular handling with this new header and it is not required by the Twirp spec, but it's recommended that clients set it in other language implementations as well.Published by spenczar over 6 years ago
This release includes the following changes:
Context values describing the requested service, package, and method are now
available to HTTPClients passed to generated Twirp clients.
(a22cc722f7feaeb12b7768699bf5e202464fa4b0)
Generated clients no longer emit logs to the standard library logger under any
circumstances. Instead, they will return any error encountered closing an HTTP
response body if they found no other errors during the request. If they hit
other errors, then HTTP response body close errors are ignored.
(c0c435531e9a1787cec6159bd6262bcf5aa48bea)
Handling of Content-Type headers with name=value pairs after the
MIME type is now correct.
(2067a95fa595ef8d484d02bdab04c922479a2225)
The vendor directory is now committed. This should make installation of
protoc-gen-twirp more straightforward.
(2642ca800080894c36e3457b9a1603e4ee752eba)
Published by spenczar over 6 years ago
Release v5.1.0 improves the flexibility of client constructors. It also fixes some typos, fixes a bug in the generator, and makes minor performance improvements.
Generated client constructors now accept an interface, type HTTPClient interface { Do(*http.Request) (*http.Response, error) }
instead of the concrete type *http.Client
. This lets users provide clients that smartly retry or use custom service discovery systems. It should be backwards compatible, as *http.Client
fulfills that interface and can still be plugged in without changes. This is #39, and was proposed and designed in #12.
Generated servers will avoid an unnecessary string concatenation when handling requests; the string is now precomputed. This is #53.
Code generation now works correctly if a proto file imports another proto file found in the same directory. This was #15, fixed in #47.
#36 and #44 fixed typos in documenting comments and error messages.
All associated PRs bundled into this release can be tracked found here: https://github.com/twitchtv/twirp/pulls?q=is%3Apr+is%3Aclosed+milestone%3Av5.1.0
Published by spenczar almost 7 years ago
This is the first public release of Twirp. Hooray!