Commit Graph
15 Commits
Author SHA1 Message Date
Lucio FrancoandGitHub eba7ec7b32 feat: Add gRPC interceptors (#232)
This change introduces proper gRPC interceptors that are avilable
regardless of the transport used. Each codegen service now produces an
additional method called `with_interceptor` that accepts a
`Interceptor`.

All examples have been updated to use this new style and interop has a
custom `tower::Service` middleware to echo the headers. There is also a
new `interceptor` example that shows basic usage.

BREAKING CHANGE: removed `interceptor_fn` and `intercep_headers_fn` from `transport` in favor of using `tonic::Interceptor`.
2020-01-13 21:26:08 -05:00
Lucio FrancoandGitHub d9a481baef chore: Reorganize examples and interop crates (#180)
* chore: Reorganize examples and interop crates

* fix interop tests
2019-12-12 11:53:15 -05:00
Juan AlvarezandLucio Franco 6b43f63578 remove tower cargo patches (#164) 2019-12-06 12:23:37 -05:00
Lucio FrancoandGitHub 3387ef900f Upgrade to tokio 0.2 (#163) 2019-12-06 00:09:46 -05:00
James SteeleandLucio Franco b02b4b238b fix(build): Prevent duplicated client/server generated code (#121)
* fix(build): Prevent duplicated client/server generated code

The tonic-build process collects up RPC services as they are provided by
prost, before writing them out as part of the finalization step for a
given protocol buffer package.

In the case of imported protocol buffer packages, there may be RPC
services included by import in addition to those in the top-level
package. Therefore it is necessary to make sure each set of
client/server services gathered by tonic-build is cleared after the
finalization process for a given protocol buffer package, otherwise they
will be incorrectly aggregated as the generation process proceeds
through the subsequent packages.

* Test case for duplicated client/server generated code

A simple test case that will fail to build without a fix to prevent
RPC services being duplicated into inappropriate modules (that related
to particular protocol buffer packages).

* Additional test case for included_service

Introduces an additional case that captures making sure services defined
before including a package with additional services doesn't
incidentially clear such precursor services from the including package.

* Fix unnecessary newline to keep `cargo fmt` happy
2019-11-09 15:45:22 +00:00
Lucio FrancoandGitHub 1dbde95d84 fix(build): Fix service and rpc name conflict (#92)
Closes #89
2019-10-23 15:01:04 -04:00
Lucio Franco ec5778dfa1 Update interop server 2019-09-06 15:37:08 -04:00
Lucio Franco d0cfafafc6 Move codegen to build and remove macros 2019-09-06 15:19:18 -04:00
Lucio Franco 295e7321b9 Add first step of async-trait 2019-09-06 01:30:51 -04:00
Lucio Franco f750dfa111 Fix interoptests and rewrite decode 2019-08-28 17:24:53 -04:00
Lucio Franco 8dc1185a36 Add first pass at interop tests 2019-08-18 21:04:00 -04:00
Lucio Franco 5e208d9da2 First pass at macro 2019-08-15 17:50:25 -04:00
Lucio Franco 0a8aaa8071 Clean up main crate and more work on macro
Signed-off-by: Lucio Franco <[email protected]>
2019-08-15 15:09:54 -04:00
Lucio Franco 404f7d8931 Add tower-h2 and more macro 2019-08-11 13:48:13 -04:00
Lucio Franco b827fdd950 Inital commit 2019-08-09 14:01:27 -04:00