Commit Graph

126 Commits

Author SHA1 Message Date
Jakob Andersen 108181c2d2
Added support for metadata providers. (#39)
Provide a hook for metadata providers that need to generate their
metadata for each RPC. An example is authorization, where the provider
may need to refresh a token before it can provide the header.

Add stackdriver logging examplei to demonstrate calling a Google API.

Updated other examples to protobuf 0.6.0 (protoc plugin 0.7.8).

Updated SDK requirement to Dart 1.24.3, which adds support for creating a SecurityContext that trusts built-in roots, and support for ALPN on macOS.
2017-12-14 14:32:06 +01:00
Jakob Andersen 4b420f5cb4
Use thenAnswer() instead of thenReturn() when returning a Stream. (#40)
Mockito will soon start throwing an ArgumentError if thenReturn()
is called with a Future or Stream, as this can result in difficult
to trace errors.
2017-12-12 11:04:53 +01:00
Jakob Andersen b82384ee08 Prepare release 0.1.0. (#35) 2017-10-12 16:26:00 +02:00
Jakob Andersen 7b2ff3e571 Multiplex RPCs on a single connection. (#34)
A Channel will now multiplex RPCs on a single managed connection. The
connection will attempt to reconnect on failure, and will close the
underlying transport connection if no RPCs have been made for a while.

Part of #5.
2017-10-12 15:37:29 +02:00
Jakob Andersen a9b919a5e9 Added client-side interop tests. (#32) 2017-09-27 13:57:24 +02:00
Jakob Andersen 2f118ea043 Preparation for RPC multiplexing (#31)
First stage of separating Connection from Channel. A Channel manages
multiple Connections, and chooses which Connection to send an RPC on.

In this change, the Channel still creates a Connection for each RPC.
Managing the Connection life-cycle comes in a later change.
2017-09-25 13:51:40 +02:00
Jakob Andersen 05bb6a5d08 Update generated code using latest protoc_plugin. (#30)
Preparation for updating the call generation logic.
2017-08-23 12:47:48 +02:00
Jakob Andersen 83ee9c2edb Add TLS support. (#29)
Added ChannelOptions, which are used to specify options on a
ClientChannel. At the moment, only TLS options are supported.

Moved CallOptions from ClientChannel to a new Client stub base class.
Per-RPC call options are now specified on the stub instead of on the
channel, allowing several stubs with different options to share the same
channel.

Added support for TLS on the server side. TLS options are specified when
creating the Server.
2017-08-17 09:45:11 +02:00
Jakob Andersen 5c4e50c696 Add timeout handling. (#28)
Fixes #8.
2017-07-31 14:47:29 +02:00
Jakob Roland Andersen 1b997ada42 Update change log and pubspec for release 0.0.1.
Really only released to reserve the name on pub.
2017-07-18 15:23:06 +02:00
Jakob Andersen 1d12c5b87d Add basic server tests. (#27) 2017-07-18 15:14:13 +02:00
Jakob Andersen 0a0a9ffc89 Basic server interoperability tests. (#25)
Implements the basic server interoperability tests for gRPC compliance.
Compressed tests, TLS, and authentication are not implemented yet, but
basic test cases pass against the C++ gRPC interoperability client.
2017-07-17 16:12:13 +02:00
Jakob Andersen ac317e6e4d Add basic client tests. (#26) 2017-07-17 15:11:45 +02:00
Jakob Andersen d0c7d14a4e Fix analyze task (#24)
Using `dart_task: dartanalyzer lib test` didn't actually work - looks like Travis just runs the tests instead of the analyzer.

So let's try a custom script instead.
2017-07-11 10:40:44 +02:00
Jakob Andersen ed5e8fb43e Use correct gRPC error codes. (#23)
Copied error code definitions from source grpc/grpc repo.

Fixes #7.
2017-07-10 12:53:08 +02:00
Jakob Andersen a5e740c41a Custom metadata and call cancellation. (#22)
Added an example showing how to send/receive custom metadata, and handle
call cancellation.

Implemented the remaining parts of metadata and cancel handling.

Addresses part of #8 and #12.
2017-07-07 14:31:36 +02:00
Jakob Andersen aefc45cbc0 Upgrade package:http2 dependency. (#21)
Picks up fix for sending endStream bit on the requested frame, instead
of on an empty data frame following it.

Needed for interoperability with the Go gRPC client, since it otherwise
failed to recognize the trailer frame sent from the server.

Fixes #13.
2017-07-06 11:37:21 +02:00
Jakob Andersen ff962f8a8c Generated code using new protoc Dart gRPC plugin. (#20)
Updated README.md with instructions on how to regenerate the code.

Fixes #11.
2017-07-06 10:48:25 +02:00
Jakob Andersen 4775f6dd1f Rename examples to example. (#19)
To follow the Dart package guidelines.

Fixes #18.
2017-07-04 19:50:18 +02:00
Kevin Moore 4b8d407eae Fixes to make Travis Green (#17)
* Remove unused import
* Only analyze lib and test dirs
  - work-around for https://github.com/dart-lang/sdk/issues/26212
* enable a few more lints
* remove unused field
2017-06-29 13:11:29 -07:00
Kevin Moore 49f123b6ac Update readme with Travis badge (#16)
And remove redundant header info
2017-06-29 12:28:24 -07:00
Michael Thomsen b0c284578a Enable travis (#15)
* Create .travis.yml

Initial travis config, based on https://github.com/dart-lang/source_gen/blob/master/.travis.yml

* Update .travis.yml

* Fix filename

* Review feedback
2017-06-29 19:38:45 +02:00
Michael Thomsen aee8e4a3c3 Clarify that current implementation is experimental (#14) 2017-06-29 15:12:10 +02:00
Jakob Andersen bf8fb94353 Initial import. (#2)
What works:

* Client and server can talk to each other, all 4 RPC variants.
* Client can talk to Go gRPC server.

What (probably) doesn't work:

* Anything else.
2017-06-28 14:53:42 +02:00
Michael Thomsen 97dfcb1c5f Fix typo (#1) 2017-06-08 11:17:15 +02:00
Michael Thomsen ee72b4b418 Initial repo config 2017-06-08 11:12:17 +02:00