Commit Graph
314 Commits
Author SHA1 Message Date
James NugentandGitHub 6dbe88d445 fix(build): Implement Debug for client struct
Fixes #298.
2020-03-30 17:06:31 -05:00
Lucio FrancoandGitHub 3cba9f5f6f chore: Fix feature flags and build docs (#311)
Signed-off-by: Lucio Franco <[email protected]>
2020-03-30 12:02:10 -04:00
James NugentandGitHub 59c7788846 fix(health): Set referenced version of tonic 2020-03-30 09:47:04 -05:00
James NugentandGitHub da92dbf8aa feat(health): Add tonic-health server impl
This commit adds a new crate `tonic-health` which implements the
[standard GRPC Health Checking][checking] protocol.

Currently there is only a server implementation, though others have
alluded in the discussion in #135 that client implementations exist
which could also be imported as necessary.

A example server has also been added - once the client work is done a
client for this should be added also.

[checking]: https://github.com/grpc/grpc/blob/master/doc/health-checking.md

Fixes #135.
2020-03-30 09:33:02 -05:00
Johan AnderssonandGitHub 25569e007b chore(transport): Upgrade rustls and base64 (#251) 2020-03-30 10:01:48 -04:00
CameronandGitHub cfd59dbb34 feat: Add Status with Details Constructor (#308) 2020-03-30 10:01:01 -04:00
Lucio FrancoandGitHub 2e082f8b3e chore(build): Refactor codegen traits (#302)
Signed-off-by: Lucio Franco <[email protected]>
2020-03-29 12:57:11 -04:00
Michael-J-WardandGitHub 012fa3cb4a feat(transport): Expose http2 keep-alive support (#307) 2020-03-29 12:48:43 -04:00
Coenen BenjaminandGitHub 5758b758b2 fix(build): Server service uses generic body bound (#306)
Signed-off-by: Benjamin Coenen <[email protected]>
2020-03-28 12:52:10 -04:00
Juan AlvarezandGitHub e2c2be2f08 fix(build): Remove debug println! (#287) 2020-03-27 10:58:10 -04:00
James NugentandGitHub 224280dfff fix(build): Allow non_camel_case_types on codegen structs
This commit adjusts the code generation for the internal structs in the
implementation of Service<http::Request<HyperBody>> for *Server<T> in
order to annotate internal structs whose names are derived from gRPC
method names with `[allow(non_camel_case_types)]`. This supresses
compiler warnings about type names when compiling generated code. The
struct names are not exposed externally, so this has no impact on types
seen by library consumers.

Fixes #295.
2020-03-19 14:18:34 -05:00
James NugentandGitHub 61e0429ae8 fix(metadata): Remove deprecated error description
Rust 1.42 deprecates the `description()` method of `std::error::Error`
and provides a blanket implementation suggesting implementation of
`std::fmt::Display` instead. We already implemented `Display` for error
types but in terms of the deprecated `description`. This commit
implements `Display` directly and falls back to the blanket
implementation of `description()`.
2020-03-19 14:07:25 -05:00
Andrew ChinandGitHub 414a8978b8 chore: typo ruslts -> rustls (#294) 2020-03-18 18:16:02 -04:00
9e7d35a2d3 chore: Add blocknig server example (#277)
Co-authored-by: Lucio Franco <[email protected]>
2020-03-06 11:30:10 -05:00
Lucio FrancoandGitHub 7dfa2a277b fix(build): Ignore non .rs files with rustfmt (#284)
Fixes #283
2020-03-05 15:21:02 -05:00
Gyusun YeomandGitHub f65cda1ea0 feat(build): Decouple codgen from prost (#170) 2020-03-01 13:52:31 -05:00
Danny HuaandGitHub 1b3d107206 fix(build): Don't replace extern_paths (#261)
* don't replace extern_path'd paths

tonic-build will replace all paths except for google well known types
with one rooted at the super module. For paths that have already been
replaced with a fully qualified path via the extern_path config option,
(e.g. "::uuid::Uuid"), this results in an invalid path
(e.g. "super::::uuid::Uuid"), and a build failure. These paths should
also be excluded when prefixing relative modules with super.

* add doc in tonic-build clarifying extern_path

extern_path expects fully qualified proto and rust paths

* add test cast case for extern path fix

add a test that extern path does indeed result in service types using
the specified type from an external crate. we test this by creating a
service type that has a proto from a different crate, and asserting that
it does indeed impl a trait from that crate

* add license/publish to extern_path test crates
2020-02-18 09:56:32 -05:00
Lucio FrancoandGitHub e2bff8f13e chore(docs): Add warp + tonic example (#268)
Signed-off-by: Lucio Franco <[email protected]>
2020-02-16 15:13:22 -05:00
Lucio FrancoandGitHub b49ad9bb47 chore(docs): Add hyper example (#267)
Signed-off-by: Lucio Franco <[email protected]>
2020-02-16 12:46:55 -05:00
Erich GublerandGitHub 4f343eb980 chore: upgrade percent-encoding 1.0.1 -> 2.0 (#262) 2020-02-13 11:36:39 -05:00
DizansandGitHub 34865a9fb5 chore(docs): Remove unecessary pinning (#263) 2020-02-13 11:34:34 -05:00
Johan AnderssonandLucio Franco 3e63e05666 Fix 0.1.1 diff link in changelog (#247) 2020-01-20 13:53:09 -05:00
Lucio FrancoandGitHub 66ac4c4049 chore: Prepare 0.1.1 release (#246)
* chore: Prepare 0.1.1 release

* add missing pr
2020-01-20 11:53:45 -05:00
michael-a-cliqzandLucio Franco cfdf0aff54 fix(transport): Add Connected impl for TcpStream (#245) 2020-01-20 11:29:12 -05:00
Lucio FrancoandGitHub 6de0b4d26f fix(transport): Use Uri host if no domain for tls (#244)
* fix(transport): Use Uri host if no domain for tls

* Fix warnings
2020-01-20 11:21:44 -05:00
Spencer JudgeandLucio Franco 5fc6762435 fix(build): Typo with client mod docstring (#237) 2020-01-14 13:25:17 -05:00
Fuyang LiuandLucio Franco bd0f5edddf chore: Add grpcurl example in helloworld readme (#236) 2020-01-14 10:55:59 -05:00
Lucio FrancoandGitHub f4ecf47428 chore: Prepare 0.1.0 release (#234) 2020-01-14 09:36:19 -05:00
Juan AlvarezandLucio Franco 6ee2ed9b4f chore: rename ServiceName -> NamedService (#233)
BREAKING CHANGE: Rename `ServiceName` to `NamedService`.
2020-01-13 21:41:24 -05:00
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
Juan AlvarezandLucio Franco 0fa2bf1cea feat(codec): Introduce Decoder/Encoder traits (#208)
BREAKING CHANGE: Add new `Decoder/Encoder` traits and use `EncodeBuf/DecodeBuf` over `BytesMut` directly.
2020-01-13 11:59:19 -05:00
Juan AlvarezandLucio Franco a41f55ab9d fix(build): Remove default impl for Server traits (#229)
BREAKING CHANGE: remove default implementations for server traits.
2020-01-13 09:42:14 -05:00
MarcelandLucio Franco dadc8186c2 chore: Upgrade to prost, prost-build and prost-derive 0.6 (#230) (#231) 2020-01-13 09:40:57 -05:00
Lucio FrancoandGitHub af807c3ccd feat(transport): Add server side peer cert support (#228)
* feat(transport): Add server side peer cert support
2020-01-11 14:17:19 -08:00
Johan AnderssonandLucio Franco 3be8bc1668 Run CI checks & tests on Windows and Mac (#206)
* Run CI checks & tests on Windows and Mac

* Fix uds windows compile

Co-authored-by: Lucio Franco <[email protected]>
2020-01-11 14:16:54 -08:00
Lucio FrancoandGitHub 6673f91f1f chore: Remove required bytes dep and clean up deny (#227)
* chore: Remove required bytes dep and clean up deny

* Fix interop test cli args
2020-01-11 12:48:24 -08:00
Lucio FrancoandGitHub 18e944bd28 chore: Update prost codec to not use workaround (#226) 2020-01-11 12:27:00 -08:00
Adam JacobandLucio Franco 8997f47b6d chore: Upgrade to prost master and bytes 0.5 (#224)
This upgrades tonic to prost's master branch, and moves everything to
bytes 0.5.
2020-01-11 11:05:08 -08:00
Adam JacobandLucio Franco e034288c37 feat(build): Add extern_path config support (#223)
Adds support for prost-build's "extern_path" feature. This allows you to
reference another prost-generated protobuf, including any traits that
may have been defined for it, from another crate or location.
2020-01-10 15:31:10 -05:00
Lucio FrancoandGitHub a66595bfe3 feat(transport): Add serve_with_incoming_shutdown (#220) 2020-01-08 11:00:57 -05:00
Juan AlvarezandLucio Franco faa26ac152 chore(example) Fix routeguide errors (#218)
* chore(example) Fix routeguide errors

* remove redundant line
2020-01-07 16:53:30 -05:00
Linus FärnstrandandLucio Franco ec1f37e4b4 fix(transport): Improve Error type (#217) 2020-01-04 14:24:26 -05:00
Juan AlvarezandLucio Franco 49ce265954 chore: Add decode benchmarks (#207)
* disable current benchmarks

* temporarily expose Streaming constructor

* hide Streaming constructor from docs

* remove crossbeam-queue from deny skip list

* add decode benches

* fmt

* use Bytes as MockDecoder Item
2019-12-22 16:51:34 -05:00
Thomas MayandLucio Franco 59d008db7e chore(docs): Fix examples link (#202)
* url is just examples, not tonic-examples

* Change root directory from tonic-examples to examples.  Matches current directory structure.
2019-12-20 22:39:39 -05:00
Johan AnderssonandLucio Franco 5e6b1fe487 chore(ci): Switch to use GitHub Action for cargo-deny (#201) 2019-12-20 11:41:37 -05:00
Lucio FrancoandGitHub 61a770dedf chore: Prepare 0.1.0-beta.1 release (#200)
* chore: Prepare `0.1.0-beta.1` release

* Update changelog

* Fix tower paths
2019-12-19 18:44:25 -05:00
Lucio FrancoandGitHub 8efdbb4631 chore: Use released version of tower (#199)
* chore: Use released version of tower

* Update the rest
2019-12-19 18:31:40 -05:00
Juan AlvarezandLucio Franco 4e5c6c8f23 chore(example): update guides to 0.1-beta.1 (#198)
* update routeguide

* update helloworld

* depend on tonic beta.1

* Apply suggestions from code review

Co-Authored-By: Lucio Franco <[email protected]>

Co-authored-by: Lucio Franco <[email protected]>
2019-12-19 18:23:25 -05:00
Fletcher NicholandLucio Franco 6566b237a1 chore(docs): Fix routeguide tutorial source links (#195)
Signed-off-by: Fletcher Nichol <[email protected]>
2019-12-17 16:21:13 -05:00
Brandon WilliamsandLucio Franco c99d13c6e6 fix(transport): Fix infinite recursion in poll_ready (#192)
b90c340 (feat(transport): Allow custom IO and UDS example (#184),
2019-12-13) changed the Connector type to be more generic instead of
only allowing the HttpConnector type, during this change the
`Service::poll_ready` impl was changed from calling
`MakeConnection::poll_ready` on `self.http` to `self` resulting in
infinite recursion due to the blanket imple of
`MakeConnection::poll_ready` calling `Service::poll_ready`.

This fixes the bug by calling `MakeConnection::poll_ready` on
`self.inner` instead of `self`.

Fixes #191
2019-12-15 18:36:10 -05:00