mirror of https://github.com/grpc/grpc.git
commit
efa6af7381
2889 changed files with 85459 additions and 30354 deletions
@ -0,0 +1,8 @@ |
||||
-Ithird_party/googletest/include |
||||
-Ithird_party/googletest |
||||
-Iinclude |
||||
-Igens |
||||
-I. |
||||
-Ithird_party/boringssl/include |
||||
-Ithird_party/zlib |
||||
-Ithird_party/protobuf/src |
@ -1,225 +0,0 @@ |
||||
These instructions only cover building grpc C and C++ libraries under |
||||
typical unix systems. If you need more information, please try grpc's |
||||
wiki pages: |
||||
|
||||
https://github.com/google/grpc/wiki |
||||
|
||||
|
||||
************************* |
||||
* If you are in a hurry * |
||||
************************* |
||||
|
||||
On Linux (Debian): |
||||
|
||||
Note: you will need to add the Debian 'jessie-backports' distribution to your sources |
||||
file first. |
||||
|
||||
Add the following line to your `/etc/apt/sources.list` file: |
||||
|
||||
deb http://http.debian.net/debian jessie-backports main |
||||
|
||||
Install the gRPC library: |
||||
|
||||
$ [sudo] apt-get install libgrpc-dev |
||||
|
||||
OR |
||||
|
||||
$ git clone https://github.com/grpc/grpc.git |
||||
$ cd grpc |
||||
$ git submodule update --init |
||||
$ make |
||||
$ [sudo] make install |
||||
|
||||
You don't need anything else than GNU Make, gcc and autotools. Under a Debian |
||||
or Ubuntu system, this should boil down to the following packages: |
||||
|
||||
$ [sudo] apt-get install build-essential autoconf libtool |
||||
|
||||
Building the python wrapper requires the following: |
||||
|
||||
$ [sudo] apt-get install python-all-dev python-virtualenv |
||||
|
||||
If you want to install in a different directory than the default /usr/lib, you can |
||||
override it on the command line: |
||||
|
||||
$ [sudo] make install prefix=/opt |
||||
|
||||
|
||||
******************************* |
||||
* More detailled instructions * |
||||
******************************* |
||||
|
||||
Setting up dependencies |
||||
======================= |
||||
|
||||
Dependencies to compile the libraries |
||||
------------------------------------- |
||||
|
||||
grpc libraries have few external dependencies. If you need to compile and |
||||
install them, they are present in the third_party directory if you have |
||||
cloned the github repository recursively. If you didn't clone recursively, |
||||
you can still get them later by running the following command: |
||||
|
||||
$ git submodule update --init |
||||
|
||||
Note that the Makefile makes it much easier for you to compile from sources |
||||
if you were to clone recursively our git repository: it will automatically |
||||
compile zlib and OpenSSL, which are core requirements for grpc. Note this |
||||
creates grpc libraries that will have zlib and OpenSSL built-in inside of them, |
||||
which significantly increases the libraries' size. |
||||
|
||||
In order to decrease that size, you can manually install zlib and OpenSSL on |
||||
your system, so that the Makefile can use them instead. |
||||
|
||||
Under a Debian or Ubuntu system, one can acquire the development package |
||||
for zlib this way: |
||||
|
||||
# apt-get install zlib1g-dev |
||||
|
||||
To the best of our knowledge, no distribution has an OpenSSL package that |
||||
supports ALPN yet, so you would still have to depend on installing from source |
||||
for that particular dependency if you want to reduce the libraries' size. |
||||
|
||||
The recommended version of OpenSSL that provides ALPN support is available |
||||
at this URL: |
||||
|
||||
https://www.openssl.org/source/openssl-1.0.2.tar.gz |
||||
|
||||
|
||||
Dependencies to compile and run the tests |
||||
----------------------------------------- |
||||
|
||||
Compiling and running grpc plain-C tests dont't require any more dependency. |
||||
|
||||
|
||||
Compiling and running grpc C++ tests depend on protobuf 3.0.0, gtest and |
||||
gflags. Although gflags is provided in third_party, you will need to manually |
||||
install that dependency on your system to run these tests. |
||||
|
||||
Under a Debian or Ubuntu system, you can install the gtests and gflags packages |
||||
using apt-get: |
||||
|
||||
# apt-get install libgflags-dev libgtest-dev |
||||
|
||||
However, protobuf 3.0.0 isn't in a debian package yet, but the Makefile will |
||||
automatically try and compile the one present in third_party if you cloned the |
||||
repository recursively, and that it detects your system is lacking it. |
||||
|
||||
Compiling and installing protobuf 3.0.0 requires a few more dependencies in |
||||
itself, notably the autoconf suite. If you have apt-get, you can install |
||||
these dependencies this way: |
||||
|
||||
# apt-get install autoconf libtool |
||||
|
||||
If you want to run the tests using one of the sanitized configurations, you |
||||
will need clang and its instrumented libc++: |
||||
|
||||
# apt-get install clang libc++-dev |
||||
|
||||
Mac-specific notes: |
||||
------------------- |
||||
|
||||
For a Mac system, git is not available by default. You will first need to |
||||
install Xcode from the Mac AppStore and then run the following command from a |
||||
terminal: |
||||
|
||||
$ sudo xcode-select --install |
||||
|
||||
You should also install "port" following the instructions at |
||||
https://www.macports.org . This will reside in /opt/local/bin/port for |
||||
most Mac installations. Do the "git submodule" command listed above. |
||||
|
||||
Then execute the following for all the needed build dependencies |
||||
|
||||
$ sudo /opt/local/bin/port install autoconf automake libtool gflags cmake |
||||
$ mkdir ~/gtest-svn |
||||
$ svn checkout http://googletest.googlecode.com/svn/trunk/ gtest-svn |
||||
$ mkdir mybuild |
||||
$ cd mybuild |
||||
$ cmake ../gtest-svn |
||||
$ make |
||||
$ make gtest.a gtest_main.a |
||||
$ sudo cp libgtest.a libgtest_main.a /opt/local/lib |
||||
$ sudo mkdir /opt/local/include/gtest |
||||
$ sudo cp -pr ../gtest-svn/include/gtest /opt/local/include/gtest |
||||
|
||||
We will also need to make openssl and install it appropriately |
||||
|
||||
$ cd <git directory> |
||||
$ cd third_party/openssl |
||||
$ ./config |
||||
$ sudo make install |
||||
$ cd ../../ |
||||
|
||||
If you are going to make changes and need to regenerate the projects file, |
||||
you will need to install certain modules for python. |
||||
|
||||
$ sudo easy_install simplejson mako |
||||
|
||||
Mingw-specific notes: |
||||
--------------------- |
||||
|
||||
While gRPC compiles properly under mingw, some more preparation work is needed. |
||||
The recommendation is to use msys2. The installation instructions are available |
||||
at that address: http://msys2.github.io/ |
||||
|
||||
Once this is installed, make sure you are using the following: MinGW-w64 Win64. |
||||
You'll be required to install a few more packages: |
||||
|
||||
$ pacman -S make mingw-w64-x86_64-gcc mingw-w64-x86_64-zlib autoconf automake libtool |
||||
|
||||
Please also install OpenSSL from that website: |
||||
|
||||
http://slproweb.com/products/Win32OpenSSL.html |
||||
|
||||
The package Win64 OpenSSL v1.0.2a should do. At that point you should be able |
||||
to compile gRPC with the following: |
||||
|
||||
$ export LDFLAGS="-L/mingw64/lib -L/c/OpenSSL-Win64" |
||||
$ export CPPFLAGS="-I/mingw64/include -I/c/OpenSSL-Win64/include" |
||||
$ make |
||||
|
||||
A word on OpenSSL |
||||
----------------- |
||||
|
||||
Secure HTTP2 requires the TLS extension ALPN (see rfc 7301 and |
||||
http://http2.github.io/http2-spec/ section 3.3). Our HTTP2 implementation |
||||
relies on OpenSSL's implementation. OpenSSL 1.0.2 is the first released version |
||||
of OpenSSL that has ALPN support, and this explains our dependency on it. |
||||
|
||||
Note that the Makefile supports compiling only the unsecure elements of grpc, |
||||
and if you do not have OpenSSL and do not want it, you can still proceed |
||||
with installing only the elements you require. However, we strongly recommend |
||||
the use of encryption for all network traffic, and discourage the use of grpc |
||||
without TLS. |
||||
|
||||
|
||||
Compiling |
||||
========= |
||||
|
||||
If you have all the dependencies mentioned above, you should simply be able |
||||
to go ahead and run "make" to compile grpc's C and C++ libraries: |
||||
|
||||
$ make |
||||
|
||||
|
||||
Testing |
||||
======= |
||||
|
||||
To build and run the tests, you can run the command: |
||||
|
||||
$ make test |
||||
|
||||
If you want to be able to run them in parallel, and get better output, you can |
||||
also use the python tool we have written: |
||||
|
||||
$ ./tools/run_tests/run_tests.py |
||||
|
||||
|
||||
Installing |
||||
========== |
||||
|
||||
Once everything is compiled, you should be able to install grpc C and C++ |
||||
libraries and headers: |
||||
|
||||
# make install |
@ -0,0 +1,57 @@ |
||||
#If you are in a hurry |
||||
|
||||
For language-specific installation instructions for gRPC runtime, please |
||||
refer to these documents |
||||
|
||||
* [C++](examples/cpp): Currently to install gRPC for C++, you need to build from source as described below. |
||||
* [C#](src/csharp): NuGet package `Grpc` |
||||
* [Go](https://github.com/grpc/grpc-go): `go get google.golang.org/grpc` |
||||
* [Java](https://github.com/grpc/grpc-java) |
||||
* [Node](src/node): `npm install grpc` |
||||
* [Objective-C](src/objective-c) |
||||
* [PHP](src/php): `pecl install grpc-beta` |
||||
* [Python](src/python/grpcio): `pip install grpcio` |
||||
* [Ruby](src/ruby): `gem install grpc` |
||||
|
||||
|
||||
#Pre-requisites |
||||
|
||||
##Linux |
||||
|
||||
```sh |
||||
$ [sudo] apt-get install build-essential autoconf libtool |
||||
``` |
||||
|
||||
##Mac OSX |
||||
|
||||
For a Mac system, git is not available by default. You will first need to |
||||
install Xcode from the Mac AppStore and then run the following command from a |
||||
terminal: |
||||
|
||||
```sh |
||||
$ [sudo] xcode-select --install |
||||
``` |
||||
|
||||
##Protoc |
||||
|
||||
By default gRPC uses [protocol buffers](https://github.com/google/protobuf), |
||||
you will need the `protoc` compiler to generate stub server and client code. |
||||
|
||||
If you compile gRPC from source, as described below, the Makefile will |
||||
automatically try and compile the `protoc` in third_party if you cloned the |
||||
repository recursively and it detects that you don't already have it |
||||
installed. |
||||
|
||||
|
||||
#Build from Source |
||||
|
||||
For developers who are interested to contribute, here is how to compile the |
||||
gRPC C Core library. |
||||
|
||||
```sh |
||||
$ git clone https://github.com/grpc/grpc.git |
||||
$ cd grpc |
||||
$ git submodule update --init |
||||
$ make |
||||
$ [sudo] make install |
||||
``` |
@ -1,14 +1,28 @@ |
||||
# Top-level Items by language |
||||
|
||||
## Bazel |
||||
* [grpc.bzl](grpc.bzl) |
||||
|
||||
## Node |
||||
* [binding.gyp](binding.gyp) |
||||
* [package.json](package.json) |
||||
|
||||
## Objective-C |
||||
* [gRPC.podspec](gRPC.podspec) |
||||
|
||||
## PHP |
||||
* [composer.json](composer.json) |
||||
* [config.m4](config.m4) |
||||
* [package.xml](package.xml) |
||||
|
||||
## Python |
||||
* [requirements.txt](requirements.txt) |
||||
* [setup.cfg](setup.cfg) |
||||
* [setup.py](setup.py) |
||||
* [tox.ini](tox.ini) |
||||
* [PYTHON-MANIFEST.in](PYTHON-MANIFEST.in) |
||||
|
||||
## Ruby |
||||
* [Gemfile](Gemfile) |
||||
* [grpc.gemspec](grpc.gemspec) |
||||
* [Rakefile](Rakefile) |
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,617 @@ |
||||
PHP_ARG_ENABLE(grpc, whether to enable grpc support, |
||||
[ --enable-grpc Enable grpc support]) |
||||
|
||||
if test "$PHP_GRPC" != "no"; then |
||||
dnl Write more examples of tests here... |
||||
|
||||
dnl # --with-grpc -> add include path |
||||
PHP_ADD_INCLUDE(../../grpc/include) |
||||
PHP_ADD_INCLUDE(../../grpc/src/php/ext/grpc) |
||||
PHP_ADD_INCLUDE(../../grpc/third_party/boringssl/include) |
||||
|
||||
LIBS="-lpthread $LIBS" |
||||
|
||||
GRPC_SHARED_LIBADD="-lpthread $GRPC_SHARED_LIBADD" |
||||
PHP_ADD_LIBRARY(pthread) |
||||
|
||||
PHP_ADD_LIBRARY(dl,,GRPC_SHARED_LIBADD) |
||||
PHP_ADD_LIBRARY(dl) |
||||
|
||||
case $host in |
||||
*darwin*) ;; |
||||
*) |
||||
PHP_ADD_LIBRARY(rt,,GRPC_SHARED_LIBADD) |
||||
PHP_ADD_LIBRARY(rt) |
||||
;; |
||||
esac |
||||
|
||||
PHP_NEW_EXTENSION(grpc, |
||||
src/php/ext/grpc/byte_buffer.c \ |
||||
src/php/ext/grpc/call.c \ |
||||
src/php/ext/grpc/call_credentials.c \ |
||||
src/php/ext/grpc/channel.c \ |
||||
src/php/ext/grpc/channel_credentials.c \ |
||||
src/php/ext/grpc/completion_queue.c \ |
||||
src/php/ext/grpc/php_grpc.c \ |
||||
src/php/ext/grpc/server.c \ |
||||
src/php/ext/grpc/server_credentials.c \ |
||||
src/php/ext/grpc/timeval.c \ |
||||
src/core/lib/profiling/basic_timers.c \ |
||||
src/core/lib/profiling/stap_timers.c \ |
||||
src/core/lib/support/alloc.c \ |
||||
src/core/lib/support/avl.c \ |
||||
src/core/lib/support/backoff.c \ |
||||
src/core/lib/support/cmdline.c \ |
||||
src/core/lib/support/cpu_iphone.c \ |
||||
src/core/lib/support/cpu_linux.c \ |
||||
src/core/lib/support/cpu_posix.c \ |
||||
src/core/lib/support/cpu_windows.c \ |
||||
src/core/lib/support/env_linux.c \ |
||||
src/core/lib/support/env_posix.c \ |
||||
src/core/lib/support/env_win32.c \ |
||||
src/core/lib/support/histogram.c \ |
||||
src/core/lib/support/host_port.c \ |
||||
src/core/lib/support/load_file.c \ |
||||
src/core/lib/support/log.c \ |
||||
src/core/lib/support/log_android.c \ |
||||
src/core/lib/support/log_linux.c \ |
||||
src/core/lib/support/log_posix.c \ |
||||
src/core/lib/support/log_win32.c \ |
||||
src/core/lib/support/murmur_hash.c \ |
||||
src/core/lib/support/slice.c \ |
||||
src/core/lib/support/slice_buffer.c \ |
||||
src/core/lib/support/stack_lockfree.c \ |
||||
src/core/lib/support/string.c \ |
||||
src/core/lib/support/string_posix.c \ |
||||
src/core/lib/support/string_win32.c \ |
||||
src/core/lib/support/subprocess_posix.c \ |
||||
src/core/lib/support/subprocess_windows.c \ |
||||
src/core/lib/support/sync.c \ |
||||
src/core/lib/support/sync_posix.c \ |
||||
src/core/lib/support/sync_win32.c \ |
||||
src/core/lib/support/thd.c \ |
||||
src/core/lib/support/thd_posix.c \ |
||||
src/core/lib/support/thd_win32.c \ |
||||
src/core/lib/support/time.c \ |
||||
src/core/lib/support/time_posix.c \ |
||||
src/core/lib/support/time_precise.c \ |
||||
src/core/lib/support/time_win32.c \ |
||||
src/core/lib/support/tls_pthread.c \ |
||||
src/core/lib/support/tmpfile_posix.c \ |
||||
src/core/lib/support/tmpfile_win32.c \ |
||||
src/core/lib/support/wrap_memcpy.c \ |
||||
src/core/ext/census/context.c \ |
||||
src/core/ext/census/grpc_context.c \ |
||||
src/core/ext/census/grpc_filter.c \ |
||||
src/core/ext/census/grpc_plugin.c \ |
||||
src/core/ext/census/initialize.c \ |
||||
src/core/ext/census/mlog.c \ |
||||
src/core/ext/census/operation.c \ |
||||
src/core/ext/census/placeholders.c \ |
||||
src/core/ext/census/tracing.c \ |
||||
src/core/ext/client_config/channel_connectivity.c \ |
||||
src/core/ext/client_config/client_channel.c \ |
||||
src/core/ext/client_config/client_channel_factory.c \ |
||||
src/core/ext/client_config/client_config.c \ |
||||
src/core/ext/client_config/connector.c \ |
||||
src/core/ext/client_config/default_initial_connect_string.c \ |
||||
src/core/ext/client_config/initial_connect_string.c \ |
||||
src/core/ext/client_config/lb_policy.c \ |
||||
src/core/ext/client_config/lb_policy_factory.c \ |
||||
src/core/ext/client_config/lb_policy_registry.c \ |
||||
src/core/ext/client_config/resolver.c \ |
||||
src/core/ext/client_config/resolver_factory.c \ |
||||
src/core/ext/client_config/resolver_registry.c \ |
||||
src/core/ext/client_config/subchannel.c \ |
||||
src/core/ext/client_config/subchannel_call_holder.c \ |
||||
src/core/ext/client_config/subchannel_index.c \ |
||||
src/core/ext/client_config/uri_parser.c \ |
||||
src/core/ext/lb_policy/grpclb/load_balancer_api.c \ |
||||
src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c \ |
||||
src/core/ext/lb_policy/pick_first/pick_first.c \ |
||||
src/core/ext/lb_policy/round_robin/round_robin.c \ |
||||
src/core/ext/resolver/dns/native/dns_resolver.c \ |
||||
src/core/ext/resolver/sockaddr/sockaddr_resolver.c \ |
||||
src/core/ext/transport/chttp2/client/insecure/channel_create.c \ |
||||
src/core/ext/transport/chttp2/client/secure/secure_channel_create.c \ |
||||
src/core/ext/transport/chttp2/server/insecure/server_chttp2.c \ |
||||
src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.c \ |
||||
src/core/ext/transport/chttp2/transport/alpn.c \ |
||||
src/core/ext/transport/chttp2/transport/bin_encoder.c \ |
||||
src/core/ext/transport/chttp2/transport/chttp2_transport.c \ |
||||
src/core/ext/transport/chttp2/transport/frame_data.c \ |
||||
src/core/ext/transport/chttp2/transport/frame_goaway.c \ |
||||
src/core/ext/transport/chttp2/transport/frame_ping.c \ |
||||
src/core/ext/transport/chttp2/transport/frame_rst_stream.c \ |
||||
src/core/ext/transport/chttp2/transport/frame_settings.c \ |
||||
src/core/ext/transport/chttp2/transport/frame_window_update.c \ |
||||
src/core/ext/transport/chttp2/transport/hpack_encoder.c \ |
||||
src/core/ext/transport/chttp2/transport/hpack_parser.c \ |
||||
src/core/ext/transport/chttp2/transport/hpack_table.c \ |
||||
src/core/ext/transport/chttp2/transport/huffsyms.c \ |
||||
src/core/ext/transport/chttp2/transport/incoming_metadata.c \ |
||||
src/core/ext/transport/chttp2/transport/parsing.c \ |
||||
src/core/ext/transport/chttp2/transport/status_conversion.c \ |
||||
src/core/ext/transport/chttp2/transport/stream_lists.c \ |
||||
src/core/ext/transport/chttp2/transport/stream_map.c \ |
||||
src/core/ext/transport/chttp2/transport/timeout_encoding.c \ |
||||
src/core/ext/transport/chttp2/transport/varint.c \ |
||||
src/core/ext/transport/chttp2/transport/writing.c \ |
||||
src/core/lib/channel/channel_args.c \ |
||||
src/core/lib/channel/channel_stack.c \ |
||||
src/core/lib/channel/channel_stack_builder.c \ |
||||
src/core/lib/channel/compress_filter.c \ |
||||
src/core/lib/channel/connected_channel.c \ |
||||
src/core/lib/channel/http_client_filter.c \ |
||||
src/core/lib/channel/http_server_filter.c \ |
||||
src/core/lib/compression/compression_algorithm.c \ |
||||
src/core/lib/compression/message_compress.c \ |
||||
src/core/lib/debug/trace.c \ |
||||
src/core/lib/http/format_request.c \ |
||||
src/core/lib/http/httpcli.c \ |
||||
src/core/lib/http/httpcli_security_connector.c \ |
||||
src/core/lib/http/parser.c \ |
||||
src/core/lib/iomgr/closure.c \ |
||||
src/core/lib/iomgr/endpoint.c \ |
||||
src/core/lib/iomgr/endpoint_pair_posix.c \ |
||||
src/core/lib/iomgr/endpoint_pair_windows.c \ |
||||
src/core/lib/iomgr/ev_poll_and_epoll_posix.c \ |
||||
src/core/lib/iomgr/ev_posix.c \ |
||||
src/core/lib/iomgr/exec_ctx.c \ |
||||
src/core/lib/iomgr/executor.c \ |
||||
src/core/lib/iomgr/iocp_windows.c \ |
||||
src/core/lib/iomgr/iomgr.c \ |
||||
src/core/lib/iomgr/iomgr_posix.c \ |
||||
src/core/lib/iomgr/iomgr_windows.c \ |
||||
src/core/lib/iomgr/pollset_set_windows.c \ |
||||
src/core/lib/iomgr/pollset_windows.c \ |
||||
src/core/lib/iomgr/resolve_address_posix.c \ |
||||
src/core/lib/iomgr/resolve_address_windows.c \ |
||||
src/core/lib/iomgr/sockaddr_utils.c \ |
||||
src/core/lib/iomgr/socket_utils_common_posix.c \ |
||||
src/core/lib/iomgr/socket_utils_linux.c \ |
||||
src/core/lib/iomgr/socket_utils_posix.c \ |
||||
src/core/lib/iomgr/socket_windows.c \ |
||||
src/core/lib/iomgr/tcp_client_posix.c \ |
||||
src/core/lib/iomgr/tcp_client_windows.c \ |
||||
src/core/lib/iomgr/tcp_posix.c \ |
||||
src/core/lib/iomgr/tcp_server_posix.c \ |
||||
src/core/lib/iomgr/tcp_server_windows.c \ |
||||
src/core/lib/iomgr/tcp_windows.c \ |
||||
src/core/lib/iomgr/time_averaged_stats.c \ |
||||
src/core/lib/iomgr/timer.c \ |
||||
src/core/lib/iomgr/timer_heap.c \ |
||||
src/core/lib/iomgr/udp_server.c \ |
||||
src/core/lib/iomgr/unix_sockets_posix.c \ |
||||
src/core/lib/iomgr/unix_sockets_posix_noop.c \ |
||||
src/core/lib/iomgr/wakeup_fd_eventfd.c \ |
||||
src/core/lib/iomgr/wakeup_fd_nospecial.c \ |
||||
src/core/lib/iomgr/wakeup_fd_pipe.c \ |
||||
src/core/lib/iomgr/wakeup_fd_posix.c \ |
||||
src/core/lib/iomgr/workqueue_posix.c \ |
||||
src/core/lib/iomgr/workqueue_windows.c \ |
||||
src/core/lib/json/json.c \ |
||||
src/core/lib/json/json_reader.c \ |
||||
src/core/lib/json/json_string.c \ |
||||
src/core/lib/json/json_writer.c \ |
||||
src/core/lib/security/b64.c \ |
||||
src/core/lib/security/client_auth_filter.c \ |
||||
src/core/lib/security/credentials.c \ |
||||
src/core/lib/security/credentials_metadata.c \ |
||||
src/core/lib/security/credentials_posix.c \ |
||||
src/core/lib/security/credentials_win32.c \ |
||||
src/core/lib/security/google_default_credentials.c \ |
||||
src/core/lib/security/handshake.c \ |
||||
src/core/lib/security/json_token.c \ |
||||
src/core/lib/security/jwt_verifier.c \ |
||||
src/core/lib/security/secure_endpoint.c \ |
||||
src/core/lib/security/security_connector.c \ |
||||
src/core/lib/security/security_context.c \ |
||||
src/core/lib/security/server_auth_filter.c \ |
||||
src/core/lib/surface/alarm.c \ |
||||
src/core/lib/surface/api_trace.c \ |
||||
src/core/lib/surface/byte_buffer.c \ |
||||
src/core/lib/surface/byte_buffer_reader.c \ |
||||
src/core/lib/surface/call.c \ |
||||
src/core/lib/surface/call_details.c \ |
||||
src/core/lib/surface/call_log_batch.c \ |
||||
src/core/lib/surface/channel.c \ |
||||
src/core/lib/surface/channel_init.c \ |
||||
src/core/lib/surface/channel_ping.c \ |
||||
src/core/lib/surface/channel_stack_type.c \ |
||||
src/core/lib/surface/completion_queue.c \ |
||||
src/core/lib/surface/event_string.c \ |
||||
src/core/lib/surface/init.c \ |
||||
src/core/lib/surface/init_secure.c \ |
||||
src/core/lib/surface/lame_client.c \ |
||||
src/core/lib/surface/metadata_array.c \ |
||||
src/core/lib/surface/server.c \ |
||||
src/core/lib/surface/validate_metadata.c \ |
||||
src/core/lib/surface/version.c \ |
||||
src/core/lib/transport/byte_stream.c \ |
||||
src/core/lib/transport/connectivity_state.c \ |
||||
src/core/lib/transport/metadata.c \ |
||||
src/core/lib/transport/metadata_batch.c \ |
||||
src/core/lib/transport/static_metadata.c \ |
||||
src/core/lib/transport/transport.c \ |
||||
src/core/lib/transport/transport_op_string.c \ |
||||
src/core/lib/tsi/fake_transport_security.c \ |
||||
src/core/lib/tsi/ssl_transport_security.c \ |
||||
src/core/lib/tsi/transport_security.c \ |
||||
src/core/plugin_registry/grpc_plugin_registry.c \ |
||||
third_party/nanopb/pb_common.c \ |
||||
third_party/nanopb/pb_decode.c \ |
||||
third_party/nanopb/pb_encode.c \ |
||||
src/boringssl/err_data.c \ |
||||
third_party/boringssl/crypto/aes/aes.c \ |
||||
third_party/boringssl/crypto/aes/mode_wrappers.c \ |
||||
third_party/boringssl/crypto/asn1/a_bitstr.c \ |
||||
third_party/boringssl/crypto/asn1/a_bool.c \ |
||||
third_party/boringssl/crypto/asn1/a_bytes.c \ |
||||
third_party/boringssl/crypto/asn1/a_d2i_fp.c \ |
||||
third_party/boringssl/crypto/asn1/a_dup.c \ |
||||
third_party/boringssl/crypto/asn1/a_enum.c \ |
||||
third_party/boringssl/crypto/asn1/a_gentm.c \ |
||||
third_party/boringssl/crypto/asn1/a_i2d_fp.c \ |
||||
third_party/boringssl/crypto/asn1/a_int.c \ |
||||
third_party/boringssl/crypto/asn1/a_mbstr.c \ |
||||
third_party/boringssl/crypto/asn1/a_object.c \ |
||||
third_party/boringssl/crypto/asn1/a_octet.c \ |
||||
third_party/boringssl/crypto/asn1/a_print.c \ |
||||
third_party/boringssl/crypto/asn1/a_strnid.c \ |
||||
third_party/boringssl/crypto/asn1/a_time.c \ |
||||
third_party/boringssl/crypto/asn1/a_type.c \ |
||||
third_party/boringssl/crypto/asn1/a_utctm.c \ |
||||
third_party/boringssl/crypto/asn1/a_utf8.c \ |
||||
third_party/boringssl/crypto/asn1/asn1_lib.c \ |
||||
third_party/boringssl/crypto/asn1/asn1_par.c \ |
||||
third_party/boringssl/crypto/asn1/asn_pack.c \ |
||||
third_party/boringssl/crypto/asn1/bio_asn1.c \ |
||||
third_party/boringssl/crypto/asn1/bio_ndef.c \ |
||||
third_party/boringssl/crypto/asn1/f_enum.c \ |
||||
third_party/boringssl/crypto/asn1/f_int.c \ |
||||
third_party/boringssl/crypto/asn1/f_string.c \ |
||||
third_party/boringssl/crypto/asn1/t_bitst.c \ |
||||
third_party/boringssl/crypto/asn1/t_pkey.c \ |
||||
third_party/boringssl/crypto/asn1/tasn_dec.c \ |
||||
third_party/boringssl/crypto/asn1/tasn_enc.c \ |
||||
third_party/boringssl/crypto/asn1/tasn_fre.c \ |
||||
third_party/boringssl/crypto/asn1/tasn_new.c \ |
||||
third_party/boringssl/crypto/asn1/tasn_prn.c \ |
||||
third_party/boringssl/crypto/asn1/tasn_typ.c \ |
||||
third_party/boringssl/crypto/asn1/tasn_utl.c \ |
||||
third_party/boringssl/crypto/asn1/x_bignum.c \ |
||||
third_party/boringssl/crypto/asn1/x_long.c \ |
||||
third_party/boringssl/crypto/base64/base64.c \ |
||||
third_party/boringssl/crypto/bio/bio.c \ |
||||
third_party/boringssl/crypto/bio/bio_mem.c \ |
||||
third_party/boringssl/crypto/bio/buffer.c \ |
||||
third_party/boringssl/crypto/bio/connect.c \ |
||||
third_party/boringssl/crypto/bio/fd.c \ |
||||
third_party/boringssl/crypto/bio/file.c \ |
||||
third_party/boringssl/crypto/bio/hexdump.c \ |
||||
third_party/boringssl/crypto/bio/pair.c \ |
||||
third_party/boringssl/crypto/bio/printf.c \ |
||||
third_party/boringssl/crypto/bio/socket.c \ |
||||
third_party/boringssl/crypto/bio/socket_helper.c \ |
||||
third_party/boringssl/crypto/bn/add.c \ |
||||
third_party/boringssl/crypto/bn/asm/x86_64-gcc.c \ |
||||
third_party/boringssl/crypto/bn/bn.c \ |
||||
third_party/boringssl/crypto/bn/bn_asn1.c \ |
||||
third_party/boringssl/crypto/bn/cmp.c \ |
||||
third_party/boringssl/crypto/bn/convert.c \ |
||||
third_party/boringssl/crypto/bn/ctx.c \ |
||||
third_party/boringssl/crypto/bn/div.c \ |
||||
third_party/boringssl/crypto/bn/exponentiation.c \ |
||||
third_party/boringssl/crypto/bn/gcd.c \ |
||||
third_party/boringssl/crypto/bn/generic.c \ |
||||
third_party/boringssl/crypto/bn/kronecker.c \ |
||||
third_party/boringssl/crypto/bn/montgomery.c \ |
||||
third_party/boringssl/crypto/bn/mul.c \ |
||||
third_party/boringssl/crypto/bn/prime.c \ |
||||
third_party/boringssl/crypto/bn/random.c \ |
||||
third_party/boringssl/crypto/bn/rsaz_exp.c \ |
||||
third_party/boringssl/crypto/bn/shift.c \ |
||||
third_party/boringssl/crypto/bn/sqrt.c \ |
||||
third_party/boringssl/crypto/buf/buf.c \ |
||||
third_party/boringssl/crypto/bytestring/ber.c \ |
||||
third_party/boringssl/crypto/bytestring/cbb.c \ |
||||
third_party/boringssl/crypto/bytestring/cbs.c \ |
||||
third_party/boringssl/crypto/chacha/chacha_generic.c \ |
||||
third_party/boringssl/crypto/chacha/chacha_vec.c \ |
||||
third_party/boringssl/crypto/cipher/aead.c \ |
||||
third_party/boringssl/crypto/cipher/cipher.c \ |
||||
third_party/boringssl/crypto/cipher/derive_key.c \ |
||||
third_party/boringssl/crypto/cipher/e_aes.c \ |
||||
third_party/boringssl/crypto/cipher/e_chacha20poly1305.c \ |
||||
third_party/boringssl/crypto/cipher/e_des.c \ |
||||
third_party/boringssl/crypto/cipher/e_null.c \ |
||||
third_party/boringssl/crypto/cipher/e_rc2.c \ |
||||
third_party/boringssl/crypto/cipher/e_rc4.c \ |
||||
third_party/boringssl/crypto/cipher/e_ssl3.c \ |
||||
third_party/boringssl/crypto/cipher/e_tls.c \ |
||||
third_party/boringssl/crypto/cipher/tls_cbc.c \ |
||||
third_party/boringssl/crypto/cmac/cmac.c \ |
||||
third_party/boringssl/crypto/conf/conf.c \ |
||||
third_party/boringssl/crypto/cpu-arm.c \ |
||||
third_party/boringssl/crypto/cpu-intel.c \ |
||||
third_party/boringssl/crypto/crypto.c \ |
||||
third_party/boringssl/crypto/curve25519/curve25519.c \ |
||||
third_party/boringssl/crypto/des/des.c \ |
||||
third_party/boringssl/crypto/dh/check.c \ |
||||
third_party/boringssl/crypto/dh/dh.c \ |
||||
third_party/boringssl/crypto/dh/dh_asn1.c \ |
||||
third_party/boringssl/crypto/dh/params.c \ |
||||
third_party/boringssl/crypto/digest/digest.c \ |
||||
third_party/boringssl/crypto/digest/digests.c \ |
||||
third_party/boringssl/crypto/directory_posix.c \ |
||||
third_party/boringssl/crypto/directory_win.c \ |
||||
third_party/boringssl/crypto/dsa/dsa.c \ |
||||
third_party/boringssl/crypto/dsa/dsa_asn1.c \ |
||||
third_party/boringssl/crypto/ec/ec.c \ |
||||
third_party/boringssl/crypto/ec/ec_asn1.c \ |
||||
third_party/boringssl/crypto/ec/ec_key.c \ |
||||
third_party/boringssl/crypto/ec/ec_montgomery.c \ |
||||
third_party/boringssl/crypto/ec/oct.c \ |
||||
third_party/boringssl/crypto/ec/p224-64.c \ |
||||
third_party/boringssl/crypto/ec/p256-64.c \ |
||||
third_party/boringssl/crypto/ec/p256-x86_64.c \ |
||||
third_party/boringssl/crypto/ec/simple.c \ |
||||
third_party/boringssl/crypto/ec/util-64.c \ |
||||
third_party/boringssl/crypto/ec/wnaf.c \ |
||||
third_party/boringssl/crypto/ecdh/ecdh.c \ |
||||
third_party/boringssl/crypto/ecdsa/ecdsa.c \ |
||||
third_party/boringssl/crypto/ecdsa/ecdsa_asn1.c \ |
||||
third_party/boringssl/crypto/engine/engine.c \ |
||||
third_party/boringssl/crypto/err/err.c \ |
||||
third_party/boringssl/crypto/evp/algorithm.c \ |
||||
third_party/boringssl/crypto/evp/digestsign.c \ |
||||
third_party/boringssl/crypto/evp/evp.c \ |
||||
third_party/boringssl/crypto/evp/evp_asn1.c \ |
||||
third_party/boringssl/crypto/evp/evp_ctx.c \ |
||||
third_party/boringssl/crypto/evp/p_dsa_asn1.c \ |
||||
third_party/boringssl/crypto/evp/p_ec.c \ |
||||
third_party/boringssl/crypto/evp/p_ec_asn1.c \ |
||||
third_party/boringssl/crypto/evp/p_rsa.c \ |
||||
third_party/boringssl/crypto/evp/p_rsa_asn1.c \ |
||||
third_party/boringssl/crypto/evp/pbkdf.c \ |
||||
third_party/boringssl/crypto/evp/sign.c \ |
||||
third_party/boringssl/crypto/ex_data.c \ |
||||
third_party/boringssl/crypto/hkdf/hkdf.c \ |
||||
third_party/boringssl/crypto/hmac/hmac.c \ |
||||
third_party/boringssl/crypto/lhash/lhash.c \ |
||||
third_party/boringssl/crypto/md4/md4.c \ |
||||
third_party/boringssl/crypto/md5/md5.c \ |
||||
third_party/boringssl/crypto/mem.c \ |
||||
third_party/boringssl/crypto/modes/cbc.c \ |
||||
third_party/boringssl/crypto/modes/cfb.c \ |
||||
third_party/boringssl/crypto/modes/ctr.c \ |
||||
third_party/boringssl/crypto/modes/gcm.c \ |
||||
third_party/boringssl/crypto/modes/ofb.c \ |
||||
third_party/boringssl/crypto/obj/obj.c \ |
||||
third_party/boringssl/crypto/obj/obj_xref.c \ |
||||
third_party/boringssl/crypto/pem/pem_all.c \ |
||||
third_party/boringssl/crypto/pem/pem_info.c \ |
||||
third_party/boringssl/crypto/pem/pem_lib.c \ |
||||
third_party/boringssl/crypto/pem/pem_oth.c \ |
||||
third_party/boringssl/crypto/pem/pem_pk8.c \ |
||||
third_party/boringssl/crypto/pem/pem_pkey.c \ |
||||
third_party/boringssl/crypto/pem/pem_x509.c \ |
||||
third_party/boringssl/crypto/pem/pem_xaux.c \ |
||||
third_party/boringssl/crypto/pkcs8/p5_pbe.c \ |
||||
third_party/boringssl/crypto/pkcs8/p5_pbev2.c \ |
||||
third_party/boringssl/crypto/pkcs8/p8_pkey.c \ |
||||
third_party/boringssl/crypto/pkcs8/pkcs8.c \ |
||||
third_party/boringssl/crypto/poly1305/poly1305.c \ |
||||
third_party/boringssl/crypto/poly1305/poly1305_arm.c \ |
||||
third_party/boringssl/crypto/poly1305/poly1305_vec.c \ |
||||
third_party/boringssl/crypto/rand/rand.c \ |
||||
third_party/boringssl/crypto/rand/urandom.c \ |
||||
third_party/boringssl/crypto/rand/windows.c \ |
||||
third_party/boringssl/crypto/rc4/rc4.c \ |
||||
third_party/boringssl/crypto/refcount_c11.c \ |
||||
third_party/boringssl/crypto/refcount_lock.c \ |
||||
third_party/boringssl/crypto/rsa/blinding.c \ |
||||
third_party/boringssl/crypto/rsa/padding.c \ |
||||
third_party/boringssl/crypto/rsa/rsa.c \ |
||||
third_party/boringssl/crypto/rsa/rsa_asn1.c \ |
||||
third_party/boringssl/crypto/rsa/rsa_impl.c \ |
||||
third_party/boringssl/crypto/sha/sha1.c \ |
||||
third_party/boringssl/crypto/sha/sha256.c \ |
||||
third_party/boringssl/crypto/sha/sha512.c \ |
||||
third_party/boringssl/crypto/stack/stack.c \ |
||||
third_party/boringssl/crypto/thread.c \ |
||||
third_party/boringssl/crypto/thread_none.c \ |
||||
third_party/boringssl/crypto/thread_pthread.c \ |
||||
third_party/boringssl/crypto/thread_win.c \ |
||||
third_party/boringssl/crypto/time_support.c \ |
||||
third_party/boringssl/crypto/x509/a_digest.c \ |
||||
third_party/boringssl/crypto/x509/a_sign.c \ |
||||
third_party/boringssl/crypto/x509/a_strex.c \ |
||||
third_party/boringssl/crypto/x509/a_verify.c \ |
||||
third_party/boringssl/crypto/x509/asn1_gen.c \ |
||||
third_party/boringssl/crypto/x509/by_dir.c \ |
||||
third_party/boringssl/crypto/x509/by_file.c \ |
||||
third_party/boringssl/crypto/x509/i2d_pr.c \ |
||||
third_party/boringssl/crypto/x509/pkcs7.c \ |
||||
third_party/boringssl/crypto/x509/t_crl.c \ |
||||
third_party/boringssl/crypto/x509/t_req.c \ |
||||
third_party/boringssl/crypto/x509/t_x509.c \ |
||||
third_party/boringssl/crypto/x509/t_x509a.c \ |
||||
third_party/boringssl/crypto/x509/x509.c \ |
||||
third_party/boringssl/crypto/x509/x509_att.c \ |
||||
third_party/boringssl/crypto/x509/x509_cmp.c \ |
||||
third_party/boringssl/crypto/x509/x509_d2.c \ |
||||
third_party/boringssl/crypto/x509/x509_def.c \ |
||||
third_party/boringssl/crypto/x509/x509_ext.c \ |
||||
third_party/boringssl/crypto/x509/x509_lu.c \ |
||||
third_party/boringssl/crypto/x509/x509_obj.c \ |
||||
third_party/boringssl/crypto/x509/x509_r2x.c \ |
||||
third_party/boringssl/crypto/x509/x509_req.c \ |
||||
third_party/boringssl/crypto/x509/x509_set.c \ |
||||
third_party/boringssl/crypto/x509/x509_trs.c \ |
||||
third_party/boringssl/crypto/x509/x509_txt.c \ |
||||
third_party/boringssl/crypto/x509/x509_v3.c \ |
||||
third_party/boringssl/crypto/x509/x509_vfy.c \ |
||||
third_party/boringssl/crypto/x509/x509_vpm.c \ |
||||
third_party/boringssl/crypto/x509/x509cset.c \ |
||||
third_party/boringssl/crypto/x509/x509name.c \ |
||||
third_party/boringssl/crypto/x509/x509rset.c \ |
||||
third_party/boringssl/crypto/x509/x509spki.c \ |
||||
third_party/boringssl/crypto/x509/x509type.c \ |
||||
third_party/boringssl/crypto/x509/x_algor.c \ |
||||
third_party/boringssl/crypto/x509/x_all.c \ |
||||
third_party/boringssl/crypto/x509/x_attrib.c \ |
||||
third_party/boringssl/crypto/x509/x_crl.c \ |
||||
third_party/boringssl/crypto/x509/x_exten.c \ |
||||
third_party/boringssl/crypto/x509/x_info.c \ |
||||
third_party/boringssl/crypto/x509/x_name.c \ |
||||
third_party/boringssl/crypto/x509/x_pkey.c \ |
||||
third_party/boringssl/crypto/x509/x_pubkey.c \ |
||||
third_party/boringssl/crypto/x509/x_req.c \ |
||||
third_party/boringssl/crypto/x509/x_sig.c \ |
||||
third_party/boringssl/crypto/x509/x_spki.c \ |
||||
third_party/boringssl/crypto/x509/x_val.c \ |
||||
third_party/boringssl/crypto/x509/x_x509.c \ |
||||
third_party/boringssl/crypto/x509/x_x509a.c \ |
||||
third_party/boringssl/crypto/x509v3/pcy_cache.c \ |
||||
third_party/boringssl/crypto/x509v3/pcy_data.c \ |
||||
third_party/boringssl/crypto/x509v3/pcy_lib.c \ |
||||
third_party/boringssl/crypto/x509v3/pcy_map.c \ |
||||
third_party/boringssl/crypto/x509v3/pcy_node.c \ |
||||
third_party/boringssl/crypto/x509v3/pcy_tree.c \ |
||||
third_party/boringssl/crypto/x509v3/v3_akey.c \ |
||||
third_party/boringssl/crypto/x509v3/v3_akeya.c \ |
||||
third_party/boringssl/crypto/x509v3/v3_alt.c \ |
||||
third_party/boringssl/crypto/x509v3/v3_bcons.c \ |
||||
third_party/boringssl/crypto/x509v3/v3_bitst.c \ |
||||
third_party/boringssl/crypto/x509v3/v3_conf.c \ |
||||
third_party/boringssl/crypto/x509v3/v3_cpols.c \ |
||||
third_party/boringssl/crypto/x509v3/v3_crld.c \ |
||||
third_party/boringssl/crypto/x509v3/v3_enum.c \ |
||||
third_party/boringssl/crypto/x509v3/v3_extku.c \ |
||||
third_party/boringssl/crypto/x509v3/v3_genn.c \ |
||||
third_party/boringssl/crypto/x509v3/v3_ia5.c \ |
||||
third_party/boringssl/crypto/x509v3/v3_info.c \ |
||||
third_party/boringssl/crypto/x509v3/v3_int.c \ |
||||
third_party/boringssl/crypto/x509v3/v3_lib.c \ |
||||
third_party/boringssl/crypto/x509v3/v3_ncons.c \ |
||||
third_party/boringssl/crypto/x509v3/v3_pci.c \ |
||||
third_party/boringssl/crypto/x509v3/v3_pcia.c \ |
||||
third_party/boringssl/crypto/x509v3/v3_pcons.c \ |
||||
third_party/boringssl/crypto/x509v3/v3_pku.c \ |
||||
third_party/boringssl/crypto/x509v3/v3_pmaps.c \ |
||||
third_party/boringssl/crypto/x509v3/v3_prn.c \ |
||||
third_party/boringssl/crypto/x509v3/v3_purp.c \ |
||||
third_party/boringssl/crypto/x509v3/v3_skey.c \ |
||||
third_party/boringssl/crypto/x509v3/v3_sxnet.c \ |
||||
third_party/boringssl/crypto/x509v3/v3_utl.c \ |
||||
third_party/boringssl/ssl/custom_extensions.c \ |
||||
third_party/boringssl/ssl/d1_both.c \ |
||||
third_party/boringssl/ssl/d1_clnt.c \ |
||||
third_party/boringssl/ssl/d1_lib.c \ |
||||
third_party/boringssl/ssl/d1_meth.c \ |
||||
third_party/boringssl/ssl/d1_pkt.c \ |
||||
third_party/boringssl/ssl/d1_srtp.c \ |
||||
third_party/boringssl/ssl/d1_srvr.c \ |
||||
third_party/boringssl/ssl/dtls_record.c \ |
||||
third_party/boringssl/ssl/pqueue/pqueue.c \ |
||||
third_party/boringssl/ssl/s3_both.c \ |
||||
third_party/boringssl/ssl/s3_clnt.c \ |
||||
third_party/boringssl/ssl/s3_enc.c \ |
||||
third_party/boringssl/ssl/s3_lib.c \ |
||||
third_party/boringssl/ssl/s3_meth.c \ |
||||
third_party/boringssl/ssl/s3_pkt.c \ |
||||
third_party/boringssl/ssl/s3_srvr.c \ |
||||
third_party/boringssl/ssl/ssl_aead_ctx.c \ |
||||
third_party/boringssl/ssl/ssl_asn1.c \ |
||||
third_party/boringssl/ssl/ssl_buffer.c \ |
||||
third_party/boringssl/ssl/ssl_cert.c \ |
||||
third_party/boringssl/ssl/ssl_cipher.c \ |
||||
third_party/boringssl/ssl/ssl_file.c \ |
||||
third_party/boringssl/ssl/ssl_lib.c \ |
||||
third_party/boringssl/ssl/ssl_rsa.c \ |
||||
third_party/boringssl/ssl/ssl_session.c \ |
||||
third_party/boringssl/ssl/ssl_stat.c \ |
||||
third_party/boringssl/ssl/t1_enc.c \ |
||||
third_party/boringssl/ssl/t1_lib.c \ |
||||
third_party/boringssl/ssl/tls_record.c \ |
||||
, $ext_shared, , -Wall -Werror \ |
||||
-Wno-parentheses-equality -Wno-unused-value -std=c11 \ |
||||
-fvisibility=hidden -DOPENSSL_NO_ASM -D_GNU_SOURCE -DWIN32_LEAN_AND_MEAN \ |
||||
-D_HAS_EXCEPTIONS=0 -DNOMINMAX) |
||||
|
||||
PHP_ADD_BUILD_DIR($ext_builddir/src/php/ext/grpc) |
||||
|
||||
PHP_ADD_BUILD_DIR($ext_builddir/src/boringssl) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/census) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/client_config) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/lb_policy/grpclb) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/lb_policy/pick_first) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/lb_policy/round_robin) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/resolver/dns/native) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/resolver/sockaddr) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/chttp2/client/insecure) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/chttp2/client/secure) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/chttp2/server/insecure) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/chttp2/server/secure) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/chttp2/transport) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/channel) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/compression) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/debug) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/http) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/iomgr) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/json) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/profiling) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/security) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/support) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/surface) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/transport) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/tsi) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/src/core/plugin_registry) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/aes) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/asn1) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/base64) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/bio) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/bn) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/bn/asm) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/buf) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/bytestring) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/chacha) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/cipher) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/cmac) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/conf) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/curve25519) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/des) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/dh) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/digest) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/dsa) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/ec) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/ecdh) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/ecdsa) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/engine) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/err) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/evp) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/hkdf) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/hmac) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/lhash) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/md4) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/md5) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/modes) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/obj) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/pem) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/pkcs8) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/poly1305) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/rand) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/rc4) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/rsa) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/sha) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/stack) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/x509) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/x509v3) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/ssl) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/ssl/pqueue) |
||||
PHP_ADD_BUILD_DIR($ext_builddir/third_party/nanopb) |
||||
fi |
@ -0,0 +1,97 @@ |
||||
Load Balancing in gRPC |
||||
======================= |
||||
|
||||
# Objective |
||||
|
||||
To design a load balancing API between a gRPC client and a Load Balancer to |
||||
instruct the client how to send load to multiple backend servers. |
||||
|
||||
# Background |
||||
|
||||
Prior to any gRPC specifics, we explore some usual ways to approach load |
||||
balancing. |
||||
|
||||
### Proxy Model |
||||
|
||||
Using a proxy provides a solid trustable client that can report load to the load |
||||
balancing system. Proxies typically require more resources to operate since they |
||||
have temporary copies of the RPC request and response. This model also increases |
||||
latency to the RPCs. |
||||
|
||||
The proxy model was deemed inefficient when considering request heavy services |
||||
like storage. |
||||
|
||||
### Balancing-aware Client |
||||
|
||||
This thicker client places more of the load balancing logic in the client. For |
||||
example, the client could contain many load balancing policies (Round Robin, |
||||
Random, etc) used to select servers from a list. In this model, a list of |
||||
servers would be either statically configured in the client, provided by the |
||||
name resolution system, an external load balancer, etc. In any case, the client |
||||
is responsible for choosing the preferred server from the list. |
||||
|
||||
One of the drawbacks of this approach is writing and maintaining the load |
||||
balancing policies in multiple languages and/or versions of the clients. These |
||||
policies can be fairly complicated. Some of the algorithms also require client |
||||
to server communication so the client would need to get thicker to support |
||||
additional RPCs to get health or load information in addition to sending RPCs |
||||
for user requests. |
||||
|
||||
It would also significantly complicate the client's code: the new design hides |
||||
the load balancing complexity of multiple layers and presents it as a simple |
||||
list of servers to the client. |
||||
|
||||
### External Load Balancing Service |
||||
|
||||
The client load balancing code is kept simple and portable, implementing |
||||
well-known algorithms (ie, Round Robin) for server selection. |
||||
Complex load balancing algorithms are instead provided by the load balancer. The |
||||
client relies on the load balancer to provide _load balancing configuration_ and |
||||
_the list of servers_ to which the client should send requests. The balancer |
||||
updates the server list as needed to balance the load as well as handle server |
||||
unavailability or health issues. The load balancer will make any necessary |
||||
complex decisions and inform the client. The load balancer may communicate with |
||||
the backend servers to collect load and health information. |
||||
|
||||
# Proposed Architecture |
||||
|
||||
The gRPC load balancing approach follows the third approach, by having an |
||||
external load balancer which provides simple clients with a list of servers. |
||||
|
||||
## Client |
||||
|
||||
When establishing a gRPC stream to the balancer, the client will send an initial |
||||
request to the load balancer (via a regular gRPC message). The load balancer |
||||
will respond with client config (including, for example, settings for flow |
||||
control, RPC deadlines, etc.) or a redirect to another load balancer. If the |
||||
balancer did not redirect the client, it will then send a list of servers to the |
||||
client. The client will contain simple load balancing logic for choosing the |
||||
next server when it needs to send a request. |
||||
|
||||
## Load Balancer |
||||
|
||||
The Load Balancer is responsible for providing the client with a list of servers |
||||
and client RPC parameters. The balancer chooses when to update the list of |
||||
servers and can decide whether to provide a complete list, a subset, or a |
||||
specific list of “picked” servers in a particular order. The balancer can |
||||
optionally provide an expiration interval after which the server list should no |
||||
longer be trusted and should be updated by the balancer. |
||||
|
||||
The load balancer may open reporting streams to each server contained in the |
||||
server list. These streams are primarily used for load reporting. For example, |
||||
Weighted Round Robin requires that the servers report utilization to the load |
||||
balancer in order to compute the next list of servers. |
||||
|
||||
## Server |
||||
|
||||
The gRPC Server is responsible for answering RPC requests and providing |
||||
responses to the client. The server will also report load to the load balancer |
||||
if a reporting stream was opened for this purpose. |
||||
|
||||
### Security |
||||
|
||||
The load balancer may be separate from the actual server backends and a |
||||
compromise of the load balancer should only lead to a compromise of the |
||||
loadbalancing functionality. In other words, a compromised load balancer should |
||||
not be able to cause a client to trust a (potentially malicious) backend server |
||||
any more than in a comparable situation without loadbalancing. |
@ -0,0 +1,10 @@ |
||||
{ |
||||
"name": "grpc-examples", |
||||
"version": "0.1.0", |
||||
"dependencies": { |
||||
"async": "^1.5.2", |
||||
"grpc": "0.13.0", |
||||
"lodash": "^4.6.1", |
||||
"minimist": "^1.2.0" |
||||
} |
||||
} |
@ -1,120 +0,0 @@ |
||||
// Copyright 2015, Google Inc. |
||||
// All rights reserved. |
||||
// |
||||
// Redistribution and use in source and binary forms, with or without |
||||
// modification, are permitted provided that the following conditions are |
||||
// met: |
||||
// |
||||
// * Redistributions of source code must retain the above copyright |
||||
// notice, this list of conditions and the following disclaimer. |
||||
// * Redistributions in binary form must reproduce the above |
||||
// copyright notice, this list of conditions and the following disclaimer |
||||
// in the documentation and/or other materials provided with the |
||||
// distribution. |
||||
// * Neither the name of Google Inc. nor the names of its |
||||
// contributors may be used to endorse or promote products derived from |
||||
// this software without specific prior written permission. |
||||
// |
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
|
||||
syntax = "proto3"; |
||||
|
||||
option java_package = "io.grpc.routeguide"; |
||||
|
||||
package routeguide; |
||||
|
||||
// Interface exported by the server. |
||||
service RouteGuide { |
||||
// A simple RPC. |
||||
// |
||||
// Obtains the feature at a given position. |
||||
rpc GetFeature(Point) returns (Feature) {} |
||||
|
||||
// A server-to-client streaming RPC. |
||||
// |
||||
// Obtains the Features available within the given Rectangle. Results are |
||||
// streamed rather than returned at once (e.g. in a response message with a |
||||
// repeated field), as the rectangle may cover a large area and contain a |
||||
// huge number of features. |
||||
rpc ListFeatures(Rectangle) returns (stream Feature) {} |
||||
|
||||
// A client-to-server streaming RPC. |
||||
// |
||||
// Accepts a stream of Points on a route being traversed, returning a |
||||
// RouteSummary when traversal is completed. |
||||
rpc RecordRoute(stream Point) returns (RouteSummary) {} |
||||
|
||||
// A Bidirectional streaming RPC. |
||||
// |
||||
// Accepts a stream of RouteNotes sent while a route is being traversed, |
||||
// while receiving other RouteNotes (e.g. from other users). |
||||
rpc RouteChat(stream RouteNote) returns (stream RouteNote) {} |
||||
} |
||||
|
||||
// Points are represented as latitude-longitude pairs in the E7 representation |
||||
// (degrees multiplied by 10**7 and rounded to the nearest integer). |
||||
// Latitudes should be in the range +/- 90 degrees and longitude should be in |
||||
// the range +/- 180 degrees (inclusive). |
||||
message Point { |
||||
optional int32 latitude = 1; |
||||
optional int32 longitude = 2; |
||||
} |
||||
|
||||
// A latitude-longitude rectangle, represented as two diagonally opposite |
||||
// points "lo" and "hi". |
||||
message Rectangle { |
||||
// One corner of the rectangle. |
||||
optional Point lo = 1; |
||||
|
||||
// The other corner of the rectangle. |
||||
optional Point hi = 2; |
||||
} |
||||
|
||||
// A feature names something at a given point. |
||||
// |
||||
// If a feature could not be named, the name is empty. |
||||
message Feature { |
||||
// The name of the feature. |
||||
optional string name = 1; |
||||
|
||||
// The point where the feature is detected. |
||||
optional Point location = 2; |
||||
} |
||||
|
||||
// A RouteNote is a message sent while at a given point. |
||||
message RouteNote { |
||||
// The location from which the message is sent. |
||||
optional Point location = 1; |
||||
|
||||
// The message to be sent. |
||||
optional string message = 2; |
||||
} |
||||
|
||||
// A RouteSummary is received in response to a RecordRoute rpc. |
||||
// |
||||
// It contains the number of individual points received, the number of |
||||
// detected features, and the total distance covered as the cumulative sum of |
||||
// the distance between each point. |
||||
message RouteSummary { |
||||
// The number of points received. |
||||
optional int32 point_count = 1; |
||||
|
||||
// The number of known features passed while traversing the route. |
||||
optional int32 feature_count = 2; |
||||
|
||||
// The distance covered in metres. |
||||
optional int32 distance = 3; |
||||
|
||||
// The duration of the traversal in seconds. |
||||
optional int32 elapsed_time = 4; |
||||
} |
@ -1,17 +1,14 @@ |
||||
{ |
||||
"name": "grpc/grpc-demo", |
||||
"description": "gRPC example for PHP", |
||||
"minimum-stability": "dev", |
||||
"repositories": [ |
||||
{ |
||||
"type": "vcs", |
||||
"url": "https://github.com/stanley-cheung/Protobuf-PHP" |
||||
} |
||||
], |
||||
"name": "grpc/grpc-demo", |
||||
"description": "gRPC example for PHP", |
||||
"minimum-stability": "dev", |
||||
"require": { |
||||
"php": ">=5.5.0", |
||||
"datto/protobuf-php": "dev-master", |
||||
"google/auth": "dev-master", |
||||
"grpc/grpc": "dev-release-0_11" |
||||
"grpc/grpc": "dev-release-0_13" |
||||
} |
||||
} |
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,97 @@ |
||||
/*
|
||||
* |
||||
* Copyright 2015, Google Inc. |
||||
* All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are |
||||
* met: |
||||
* |
||||
* * Redistributions of source code must retain the above copyright |
||||
* notice, this list of conditions and the following disclaimer. |
||||
* * Redistributions in binary form must reproduce the above |
||||
* copyright notice, this list of conditions and the following disclaimer |
||||
* in the documentation and/or other materials provided with the |
||||
* distribution. |
||||
* * Neither the name of Google Inc. nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* |
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
* |
||||
*/ |
||||
|
||||
#ifndef GRPCXX_IMPL_CODEGEN_CORE_CODEGEN_INTERFACE_H |
||||
#define GRPCXX_IMPL_CODEGEN_CORE_CODEGEN_INTERFACE_H |
||||
|
||||
#include <grpc++/impl/codegen/config_protobuf.h> |
||||
#include <grpc++/impl/codegen/status.h> |
||||
#include <grpc/impl/codegen/grpc_types.h> |
||||
|
||||
namespace grpc { |
||||
|
||||
/// Interface between the codegen library and the minimal subset of core
|
||||
/// features required by the generated code.
|
||||
///
|
||||
/// All undocumented methods are simply forwarding the call to their namesakes.
|
||||
/// Please refer to their corresponding documentation for details.
|
||||
///
|
||||
/// \warning This interface should be considered internal and private.
|
||||
class CoreCodegenInterface { |
||||
public: |
||||
// Serialize the msg into a buffer created inside the function. The caller
|
||||
// should destroy the returned buffer when done with it. If serialization
|
||||
// fails,
|
||||
// false is returned and buffer is left unchanged.
|
||||
virtual Status SerializeProto(const grpc::protobuf::Message& msg, |
||||
grpc_byte_buffer** buffer) = 0; |
||||
|
||||
// The caller keeps ownership of buffer and msg.
|
||||
virtual Status DeserializeProto(grpc_byte_buffer* buffer, |
||||
grpc::protobuf::Message* msg, |
||||
int max_message_size) = 0; |
||||
|
||||
/// Upon a failed assertion, log the error.
|
||||
virtual void assert_fail(const char* failed_assertion) = 0; |
||||
|
||||
virtual grpc_completion_queue* grpc_completion_queue_create( |
||||
void* reserved) = 0; |
||||
virtual void grpc_completion_queue_destroy(grpc_completion_queue* cq) = 0; |
||||
virtual grpc_event grpc_completion_queue_pluck(grpc_completion_queue* cq, |
||||
void* tag, |
||||
gpr_timespec deadline, |
||||
void* reserved) = 0; |
||||
|
||||
virtual void* gpr_malloc(size_t size) = 0; |
||||
virtual void gpr_free(void* p) = 0; |
||||
|
||||
virtual void grpc_byte_buffer_destroy(grpc_byte_buffer* bb) = 0; |
||||
virtual void grpc_metadata_array_init(grpc_metadata_array* array) = 0; |
||||
virtual void grpc_metadata_array_destroy(grpc_metadata_array* array) = 0; |
||||
|
||||
virtual gpr_timespec gpr_inf_future(gpr_clock_type type) = 0; |
||||
}; |
||||
|
||||
extern CoreCodegenInterface* g_core_codegen_interface; |
||||
|
||||
/// Codegen specific version of \a GPR_ASSERT.
|
||||
#define GPR_CODEGEN_ASSERT(x) \ |
||||
do { \
|
||||
if (!(x)) { \
|
||||
grpc::g_core_codegen_interface->assert_fail(#x); \
|
||||
} \
|
||||
} while (0) |
||||
|
||||
} // namespace grpc
|
||||
|
||||
#endif // GRPCXX_IMPL_CODEGEN_CORE_CODEGEN_INTERFACE_H
|
@ -0,0 +1,465 @@ |
||||
/*
|
||||
* |
||||
* Copyright 2015, Google Inc. |
||||
* All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are |
||||
* met: |
||||
* |
||||
* * Redistributions of source code must retain the above copyright |
||||
* notice, this list of conditions and the following disclaimer. |
||||
* * Redistributions in binary form must reproduce the above |
||||
* copyright notice, this list of conditions and the following disclaimer |
||||
* in the documentation and/or other materials provided with the |
||||
* distribution. |
||||
* * Neither the name of Google Inc. nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* |
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
* |
||||
*/ |
||||
|
||||
#ifndef GRPCXX_IMPL_CODEGEN_IMPL_ASYNC_STREAM_H |
||||
#define GRPCXX_IMPL_CODEGEN_IMPL_ASYNC_STREAM_H |
||||
|
||||
#include <grpc++/impl/codegen/call.h> |
||||
#include <grpc++/impl/codegen/channel_interface.h> |
||||
#include <grpc++/impl/codegen/core_codegen_interface.h> |
||||
#include <grpc++/impl/codegen/server_context.h> |
||||
#include <grpc++/impl/codegen/service_type.h> |
||||
#include <grpc++/impl/codegen/status.h> |
||||
|
||||
namespace grpc { |
||||
|
||||
class CompletionQueue; |
||||
|
||||
/// Common interface for all client side asynchronous streaming.
|
||||
class ClientAsyncStreamingInterface { |
||||
public: |
||||
virtual ~ClientAsyncStreamingInterface() {} |
||||
|
||||
/// Request notification of the reading of the initial metadata. Completion
|
||||
/// will be notified by \a tag on the associated completion queue.
|
||||
///
|
||||
/// \param[in] tag Tag identifying this request.
|
||||
virtual void ReadInitialMetadata(void* tag) = 0; |
||||
|
||||
/// Request notification completion.
|
||||
///
|
||||
/// \param[out] status To be updated with the operation status.
|
||||
/// \param[in] tag Tag identifying this request.
|
||||
virtual void Finish(Status* status, void* tag) = 0; |
||||
}; |
||||
|
||||
/// An interface that yields a sequence of messages of type \a R.
|
||||
template <class R> |
||||
class AsyncReaderInterface { |
||||
public: |
||||
virtual ~AsyncReaderInterface() {} |
||||
|
||||
/// Read a message of type \a R into \a msg. Completion will be notified by \a
|
||||
/// tag on the associated completion queue.
|
||||
///
|
||||
/// \param[out] msg Where to eventually store the read message.
|
||||
/// \param[in] tag The tag identifying the operation.
|
||||
virtual void Read(R* msg, void* tag) = 0; |
||||
}; |
||||
|
||||
/// An interface that can be fed a sequence of messages of type \a W.
|
||||
template <class W> |
||||
class AsyncWriterInterface { |
||||
public: |
||||
virtual ~AsyncWriterInterface() {} |
||||
|
||||
/// Request the writing of \a msg with identifying tag \a tag.
|
||||
///
|
||||
/// Only one write may be outstanding at any given time. This means that
|
||||
/// after calling Write, one must wait to receive \a tag from the completion
|
||||
/// queue BEFORE calling Write again.
|
||||
///
|
||||
/// \param[in] msg The message to be written.
|
||||
/// \param[in] tag The tag identifying the operation.
|
||||
virtual void Write(const W& msg, void* tag) = 0; |
||||
}; |
||||
|
||||
template <class R> |
||||
class ClientAsyncReaderInterface : public ClientAsyncStreamingInterface, |
||||
public AsyncReaderInterface<R> {}; |
||||
|
||||
template <class R> |
||||
class ClientAsyncReader GRPC_FINAL : public ClientAsyncReaderInterface<R> { |
||||
public: |
||||
/// Create a stream and write the first request out.
|
||||
template <class W> |
||||
ClientAsyncReader(ChannelInterface* channel, CompletionQueue* cq, |
||||
const RpcMethod& method, ClientContext* context, |
||||
const W& request, void* tag) |
||||
: context_(context), call_(channel->CreateCall(method, context, cq)) { |
||||
init_ops_.set_output_tag(tag); |
||||
init_ops_.SendInitialMetadata(context->send_initial_metadata_); |
||||
// TODO(ctiller): don't assert
|
||||
GPR_CODEGEN_ASSERT(init_ops_.SendMessage(request).ok()); |
||||
init_ops_.ClientSendClose(); |
||||
call_.PerformOps(&init_ops_); |
||||
} |
||||
|
||||
void ReadInitialMetadata(void* tag) GRPC_OVERRIDE { |
||||
GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); |
||||
|
||||
meta_ops_.set_output_tag(tag); |
||||
meta_ops_.RecvInitialMetadata(context_); |
||||
call_.PerformOps(&meta_ops_); |
||||
} |
||||
|
||||
void Read(R* msg, void* tag) GRPC_OVERRIDE { |
||||
read_ops_.set_output_tag(tag); |
||||
if (!context_->initial_metadata_received_) { |
||||
read_ops_.RecvInitialMetadata(context_); |
||||
} |
||||
read_ops_.RecvMessage(msg); |
||||
call_.PerformOps(&read_ops_); |
||||
} |
||||
|
||||
void Finish(Status* status, void* tag) GRPC_OVERRIDE { |
||||
finish_ops_.set_output_tag(tag); |
||||
if (!context_->initial_metadata_received_) { |
||||
finish_ops_.RecvInitialMetadata(context_); |
||||
} |
||||
finish_ops_.ClientRecvStatus(context_, status); |
||||
call_.PerformOps(&finish_ops_); |
||||
} |
||||
|
||||
private: |
||||
ClientContext* context_; |
||||
Call call_; |
||||
CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage, CallOpClientSendClose> |
||||
init_ops_; |
||||
CallOpSet<CallOpRecvInitialMetadata> meta_ops_; |
||||
CallOpSet<CallOpRecvInitialMetadata, CallOpRecvMessage<R>> read_ops_; |
||||
CallOpSet<CallOpRecvInitialMetadata, CallOpClientRecvStatus> finish_ops_; |
||||
}; |
||||
|
||||
/// Common interface for client side asynchronous writing.
|
||||
template <class W> |
||||
class ClientAsyncWriterInterface : public ClientAsyncStreamingInterface, |
||||
public AsyncWriterInterface<W> { |
||||
public: |
||||
/// Signal the client is done with the writes.
|
||||
///
|
||||
/// \param[in] tag The tag identifying the operation.
|
||||
virtual void WritesDone(void* tag) = 0; |
||||
}; |
||||
|
||||
template <class W> |
||||
class ClientAsyncWriter GRPC_FINAL : public ClientAsyncWriterInterface<W> { |
||||
public: |
||||
template <class R> |
||||
ClientAsyncWriter(ChannelInterface* channel, CompletionQueue* cq, |
||||
const RpcMethod& method, ClientContext* context, |
||||
R* response, void* tag) |
||||
: context_(context), call_(channel->CreateCall(method, context, cq)) { |
||||
finish_ops_.RecvMessage(response); |
||||
|
||||
init_ops_.set_output_tag(tag); |
||||
init_ops_.SendInitialMetadata(context->send_initial_metadata_); |
||||
call_.PerformOps(&init_ops_); |
||||
} |
||||
|
||||
void ReadInitialMetadata(void* tag) GRPC_OVERRIDE { |
||||
GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); |
||||
|
||||
meta_ops_.set_output_tag(tag); |
||||
meta_ops_.RecvInitialMetadata(context_); |
||||
call_.PerformOps(&meta_ops_); |
||||
} |
||||
|
||||
void Write(const W& msg, void* tag) GRPC_OVERRIDE { |
||||
write_ops_.set_output_tag(tag); |
||||
// TODO(ctiller): don't assert
|
||||
GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); |
||||
call_.PerformOps(&write_ops_); |
||||
} |
||||
|
||||
void WritesDone(void* tag) GRPC_OVERRIDE { |
||||
writes_done_ops_.set_output_tag(tag); |
||||
writes_done_ops_.ClientSendClose(); |
||||
call_.PerformOps(&writes_done_ops_); |
||||
} |
||||
|
||||
void Finish(Status* status, void* tag) GRPC_OVERRIDE { |
||||
finish_ops_.set_output_tag(tag); |
||||
if (!context_->initial_metadata_received_) { |
||||
finish_ops_.RecvInitialMetadata(context_); |
||||
} |
||||
finish_ops_.ClientRecvStatus(context_, status); |
||||
call_.PerformOps(&finish_ops_); |
||||
} |
||||
|
||||
private: |
||||
ClientContext* context_; |
||||
Call call_; |
||||
CallOpSet<CallOpSendInitialMetadata> init_ops_; |
||||
CallOpSet<CallOpRecvInitialMetadata> meta_ops_; |
||||
CallOpSet<CallOpSendMessage> write_ops_; |
||||
CallOpSet<CallOpClientSendClose> writes_done_ops_; |
||||
CallOpSet<CallOpRecvInitialMetadata, CallOpGenericRecvMessage, |
||||
CallOpClientRecvStatus> |
||||
finish_ops_; |
||||
}; |
||||
|
||||
/// Client-side interface for asynchronous bi-directional streaming.
|
||||
template <class W, class R> |
||||
class ClientAsyncReaderWriterInterface : public ClientAsyncStreamingInterface, |
||||
public AsyncWriterInterface<W>, |
||||
public AsyncReaderInterface<R> { |
||||
public: |
||||
/// Signal the client is done with the writes.
|
||||
///
|
||||
/// \param[in] tag The tag identifying the operation.
|
||||
virtual void WritesDone(void* tag) = 0; |
||||
}; |
||||
|
||||
template <class W, class R> |
||||
class ClientAsyncReaderWriter GRPC_FINAL |
||||
: public ClientAsyncReaderWriterInterface<W, R> { |
||||
public: |
||||
ClientAsyncReaderWriter(ChannelInterface* channel, CompletionQueue* cq, |
||||
const RpcMethod& method, ClientContext* context, |
||||
void* tag) |
||||
: context_(context), call_(channel->CreateCall(method, context, cq)) { |
||||
init_ops_.set_output_tag(tag); |
||||
init_ops_.SendInitialMetadata(context->send_initial_metadata_); |
||||
call_.PerformOps(&init_ops_); |
||||
} |
||||
|
||||
void ReadInitialMetadata(void* tag) GRPC_OVERRIDE { |
||||
GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); |
||||
|
||||
meta_ops_.set_output_tag(tag); |
||||
meta_ops_.RecvInitialMetadata(context_); |
||||
call_.PerformOps(&meta_ops_); |
||||
} |
||||
|
||||
void Read(R* msg, void* tag) GRPC_OVERRIDE { |
||||
read_ops_.set_output_tag(tag); |
||||
if (!context_->initial_metadata_received_) { |
||||
read_ops_.RecvInitialMetadata(context_); |
||||
} |
||||
read_ops_.RecvMessage(msg); |
||||
call_.PerformOps(&read_ops_); |
||||
} |
||||
|
||||
void Write(const W& msg, void* tag) GRPC_OVERRIDE { |
||||
write_ops_.set_output_tag(tag); |
||||
// TODO(ctiller): don't assert
|
||||
GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); |
||||
call_.PerformOps(&write_ops_); |
||||
} |
||||
|
||||
void WritesDone(void* tag) GRPC_OVERRIDE { |
||||
writes_done_ops_.set_output_tag(tag); |
||||
writes_done_ops_.ClientSendClose(); |
||||
call_.PerformOps(&writes_done_ops_); |
||||
} |
||||
|
||||
void Finish(Status* status, void* tag) GRPC_OVERRIDE { |
||||
finish_ops_.set_output_tag(tag); |
||||
if (!context_->initial_metadata_received_) { |
||||
finish_ops_.RecvInitialMetadata(context_); |
||||
} |
||||
finish_ops_.ClientRecvStatus(context_, status); |
||||
call_.PerformOps(&finish_ops_); |
||||
} |
||||
|
||||
private: |
||||
ClientContext* context_; |
||||
Call call_; |
||||
CallOpSet<CallOpSendInitialMetadata> init_ops_; |
||||
CallOpSet<CallOpRecvInitialMetadata> meta_ops_; |
||||
CallOpSet<CallOpRecvInitialMetadata, CallOpRecvMessage<R>> read_ops_; |
||||
CallOpSet<CallOpSendMessage> write_ops_; |
||||
CallOpSet<CallOpClientSendClose> writes_done_ops_; |
||||
CallOpSet<CallOpRecvInitialMetadata, CallOpClientRecvStatus> finish_ops_; |
||||
}; |
||||
|
||||
template <class W, class R> |
||||
class ServerAsyncReader GRPC_FINAL : public ServerAsyncStreamingInterface, |
||||
public AsyncReaderInterface<R> { |
||||
public: |
||||
explicit ServerAsyncReader(ServerContext* ctx) |
||||
: call_(nullptr, nullptr, nullptr), ctx_(ctx) {} |
||||
|
||||
void SendInitialMetadata(void* tag) GRPC_OVERRIDE { |
||||
GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); |
||||
|
||||
meta_ops_.set_output_tag(tag); |
||||
meta_ops_.SendInitialMetadata(ctx_->initial_metadata_); |
||||
ctx_->sent_initial_metadata_ = true; |
||||
call_.PerformOps(&meta_ops_); |
||||
} |
||||
|
||||
void Read(R* msg, void* tag) GRPC_OVERRIDE { |
||||
read_ops_.set_output_tag(tag); |
||||
read_ops_.RecvMessage(msg); |
||||
call_.PerformOps(&read_ops_); |
||||
} |
||||
|
||||
void Finish(const W& msg, const Status& status, void* tag) { |
||||
finish_ops_.set_output_tag(tag); |
||||
if (!ctx_->sent_initial_metadata_) { |
||||
finish_ops_.SendInitialMetadata(ctx_->initial_metadata_); |
||||
ctx_->sent_initial_metadata_ = true; |
||||
} |
||||
// The response is dropped if the status is not OK.
|
||||
if (status.ok()) { |
||||
finish_ops_.ServerSendStatus(ctx_->trailing_metadata_, |
||||
finish_ops_.SendMessage(msg)); |
||||
} else { |
||||
finish_ops_.ServerSendStatus(ctx_->trailing_metadata_, status); |
||||
} |
||||
call_.PerformOps(&finish_ops_); |
||||
} |
||||
|
||||
void FinishWithError(const Status& status, void* tag) { |
||||
GPR_CODEGEN_ASSERT(!status.ok()); |
||||
finish_ops_.set_output_tag(tag); |
||||
if (!ctx_->sent_initial_metadata_) { |
||||
finish_ops_.SendInitialMetadata(ctx_->initial_metadata_); |
||||
ctx_->sent_initial_metadata_ = true; |
||||
} |
||||
finish_ops_.ServerSendStatus(ctx_->trailing_metadata_, status); |
||||
call_.PerformOps(&finish_ops_); |
||||
} |
||||
|
||||
private: |
||||
void BindCall(Call* call) GRPC_OVERRIDE { call_ = *call; } |
||||
|
||||
Call call_; |
||||
ServerContext* ctx_; |
||||
CallOpSet<CallOpSendInitialMetadata> meta_ops_; |
||||
CallOpSet<CallOpRecvMessage<R>> read_ops_; |
||||
CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage, |
||||
CallOpServerSendStatus> |
||||
finish_ops_; |
||||
}; |
||||
|
||||
template <class W> |
||||
class ServerAsyncWriter GRPC_FINAL : public ServerAsyncStreamingInterface, |
||||
public AsyncWriterInterface<W> { |
||||
public: |
||||
explicit ServerAsyncWriter(ServerContext* ctx) |
||||
: call_(nullptr, nullptr, nullptr), ctx_(ctx) {} |
||||
|
||||
void SendInitialMetadata(void* tag) GRPC_OVERRIDE { |
||||
GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); |
||||
|
||||
meta_ops_.set_output_tag(tag); |
||||
meta_ops_.SendInitialMetadata(ctx_->initial_metadata_); |
||||
ctx_->sent_initial_metadata_ = true; |
||||
call_.PerformOps(&meta_ops_); |
||||
} |
||||
|
||||
void Write(const W& msg, void* tag) GRPC_OVERRIDE { |
||||
write_ops_.set_output_tag(tag); |
||||
if (!ctx_->sent_initial_metadata_) { |
||||
write_ops_.SendInitialMetadata(ctx_->initial_metadata_); |
||||
ctx_->sent_initial_metadata_ = true; |
||||
} |
||||
// TODO(ctiller): don't assert
|
||||
GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); |
||||
call_.PerformOps(&write_ops_); |
||||
} |
||||
|
||||
void Finish(const Status& status, void* tag) { |
||||
finish_ops_.set_output_tag(tag); |
||||
if (!ctx_->sent_initial_metadata_) { |
||||
finish_ops_.SendInitialMetadata(ctx_->initial_metadata_); |
||||
ctx_->sent_initial_metadata_ = true; |
||||
} |
||||
finish_ops_.ServerSendStatus(ctx_->trailing_metadata_, status); |
||||
call_.PerformOps(&finish_ops_); |
||||
} |
||||
|
||||
private: |
||||
void BindCall(Call* call) GRPC_OVERRIDE { call_ = *call; } |
||||
|
||||
Call call_; |
||||
ServerContext* ctx_; |
||||
CallOpSet<CallOpSendInitialMetadata> meta_ops_; |
||||
CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage> write_ops_; |
||||
CallOpSet<CallOpSendInitialMetadata, CallOpServerSendStatus> finish_ops_; |
||||
}; |
||||
|
||||
/// Server-side interface for asynchronous bi-directional streaming.
|
||||
template <class W, class R> |
||||
class ServerAsyncReaderWriter GRPC_FINAL : public ServerAsyncStreamingInterface, |
||||
public AsyncWriterInterface<W>, |
||||
public AsyncReaderInterface<R> { |
||||
public: |
||||
explicit ServerAsyncReaderWriter(ServerContext* ctx) |
||||
: call_(nullptr, nullptr, nullptr), ctx_(ctx) {} |
||||
|
||||
void SendInitialMetadata(void* tag) GRPC_OVERRIDE { |
||||
GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); |
||||
|
||||
meta_ops_.set_output_tag(tag); |
||||
meta_ops_.SendInitialMetadata(ctx_->initial_metadata_); |
||||
ctx_->sent_initial_metadata_ = true; |
||||
call_.PerformOps(&meta_ops_); |
||||
} |
||||
|
||||
void Read(R* msg, void* tag) GRPC_OVERRIDE { |
||||
read_ops_.set_output_tag(tag); |
||||
read_ops_.RecvMessage(msg); |
||||
call_.PerformOps(&read_ops_); |
||||
} |
||||
|
||||
void Write(const W& msg, void* tag) GRPC_OVERRIDE { |
||||
write_ops_.set_output_tag(tag); |
||||
if (!ctx_->sent_initial_metadata_) { |
||||
write_ops_.SendInitialMetadata(ctx_->initial_metadata_); |
||||
ctx_->sent_initial_metadata_ = true; |
||||
} |
||||
// TODO(ctiller): don't assert
|
||||
GPR_CODEGEN_ASSERT(write_ops_.SendMessage(msg).ok()); |
||||
call_.PerformOps(&write_ops_); |
||||
} |
||||
|
||||
void Finish(const Status& status, void* tag) { |
||||
finish_ops_.set_output_tag(tag); |
||||
if (!ctx_->sent_initial_metadata_) { |
||||
finish_ops_.SendInitialMetadata(ctx_->initial_metadata_); |
||||
ctx_->sent_initial_metadata_ = true; |
||||
} |
||||
finish_ops_.ServerSendStatus(ctx_->trailing_metadata_, status); |
||||
call_.PerformOps(&finish_ops_); |
||||
} |
||||
|
||||
private: |
||||
friend class ::grpc::Server; |
||||
|
||||
void BindCall(Call* call) GRPC_OVERRIDE { call_ = *call; } |
||||
|
||||
Call call_; |
||||
ServerContext* ctx_; |
||||
CallOpSet<CallOpSendInitialMetadata> meta_ops_; |
||||
CallOpSet<CallOpRecvMessage<R>> read_ops_; |
||||
CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage> write_ops_; |
||||
CallOpSet<CallOpSendInitialMetadata, CallOpServerSendStatus> finish_ops_; |
||||
}; |
||||
|
||||
} // namespace grpc
|
||||
|
||||
#endif // GRPCXX_IMPL_CODEGEN_IMPL_ASYNC_STREAM_H
|
@ -0,0 +1,152 @@ |
||||
/*
|
||||
* |
||||
* Copyright 2016, Google Inc. |
||||
* All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are |
||||
* met: |
||||
* |
||||
* * Redistributions of source code must retain the above copyright |
||||
* notice, this list of conditions and the following disclaimer. |
||||
* * Redistributions in binary form must reproduce the above |
||||
* copyright notice, this list of conditions and the following disclaimer |
||||
* in the documentation and/or other materials provided with the |
||||
* distribution. |
||||
* * Neither the name of Google Inc. nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* |
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
* |
||||
*/ |
||||
|
||||
#ifndef GRPCXX_IMPL_CODEGEN_IMPL_STATUS_CODE_ENUM_H |
||||
#define GRPCXX_IMPL_CODEGEN_IMPL_STATUS_CODE_ENUM_H |
||||
|
||||
namespace grpc { |
||||
|
||||
enum StatusCode { |
||||
/// Not an error; returned on success.
|
||||
OK = 0, |
||||
|
||||
/// The operation was cancelled (typically by the caller).
|
||||
CANCELLED = 1, |
||||
|
||||
/// Unknown error. An example of where this error may be returned is if a
|
||||
/// Status value received from another address space belongs to an error-space
|
||||
/// that is not known in this address space. Also errors raised by APIs that
|
||||
/// do not return enough error information may be converted to this error.
|
||||
UNKNOWN = 2, |
||||
|
||||
/// Client specified an invalid argument. Note that this differs from
|
||||
/// FAILED_PRECONDITION. INVALID_ARGUMENT indicates arguments that are
|
||||
/// problematic regardless of the state of the system (e.g., a malformed file
|
||||
/// name).
|
||||
INVALID_ARGUMENT = 3, |
||||
|
||||
/// Deadline expired before operation could complete. For operations that
|
||||
/// change the state of the system, this error may be returned even if the
|
||||
/// operation has completed successfully. For example, a successful response
|
||||
/// from a server could have been delayed long enough for the deadline to
|
||||
/// expire.
|
||||
DEADLINE_EXCEEDED = 4, |
||||
|
||||
/// Some requested entity (e.g., file or directory) was not found.
|
||||
NOT_FOUND = 5, |
||||
|
||||
/// Some entity that we attempted to create (e.g., file or directory) already
|
||||
/// exists.
|
||||
ALREADY_EXISTS = 6, |
||||
|
||||
/// The caller does not have permission to execute the specified operation.
|
||||
/// PERMISSION_DENIED must not be used for rejections caused by exhausting
|
||||
/// some resource (use RESOURCE_EXHAUSTED instead for those errors).
|
||||
/// PERMISSION_DENIED must not be used if the caller can not be identified
|
||||
/// (use UNAUTHENTICATED instead for those errors).
|
||||
PERMISSION_DENIED = 7, |
||||
|
||||
/// The request does not have valid authentication credentials for the
|
||||
/// operation.
|
||||
UNAUTHENTICATED = 16, |
||||
|
||||
/// Some resource has been exhausted, perhaps a per-user quota, or perhaps the
|
||||
/// entire file system is out of space.
|
||||
RESOURCE_EXHAUSTED = 8, |
||||
|
||||
/// Operation was rejected because the system is not in a state required for
|
||||
/// the operation's execution. For example, directory to be deleted may be
|
||||
/// non-empty, an rmdir operation is applied to a non-directory, etc.
|
||||
///
|
||||
/// A litmus test that may help a service implementor in deciding
|
||||
/// between FAILED_PRECONDITION, ABORTED, and UNAVAILABLE:
|
||||
/// (a) Use UNAVAILABLE if the client can retry just the failing call.
|
||||
/// (b) Use ABORTED if the client should retry at a higher-level
|
||||
/// (e.g., restarting a read-modify-write sequence).
|
||||
/// (c) Use FAILED_PRECONDITION if the client should not retry until
|
||||
/// the system state has been explicitly fixed. E.g., if an "rmdir"
|
||||
/// fails because the directory is non-empty, FAILED_PRECONDITION
|
||||
/// should be returned since the client should not retry unless
|
||||
/// they have first fixed up the directory by deleting files from it.
|
||||
/// (d) Use FAILED_PRECONDITION if the client performs conditional
|
||||
/// REST Get/Update/Delete on a resource and the resource on the
|
||||
/// server does not match the condition. E.g., conflicting
|
||||
/// read-modify-write on the same resource.
|
||||
FAILED_PRECONDITION = 9, |
||||
|
||||
/// The operation was aborted, typically due to a concurrency issue like
|
||||
/// sequencer check failures, transaction aborts, etc.
|
||||
///
|
||||
/// See litmus test above for deciding between FAILED_PRECONDITION, ABORTED,
|
||||
/// and UNAVAILABLE.
|
||||
ABORTED = 10, |
||||
|
||||
/// Operation was attempted past the valid range. E.g., seeking or reading
|
||||
/// past end of file.
|
||||
///
|
||||
/// Unlike INVALID_ARGUMENT, this error indicates a problem that may be fixed
|
||||
/// if the system state changes. For example, a 32-bit file system will
|
||||
/// generate INVALID_ARGUMENT if asked to read at an offset that is not in the
|
||||
/// range [0,2^32-1], but it will generate OUT_OF_RANGE if asked to read from
|
||||
/// an offset past the current file size.
|
||||
///
|
||||
/// There is a fair bit of overlap between FAILED_PRECONDITION and
|
||||
/// OUT_OF_RANGE. We recommend using OUT_OF_RANGE (the more specific error)
|
||||
/// when it applies so that callers who are iterating through a space can
|
||||
/// easily look for an OUT_OF_RANGE error to detect when they are done.
|
||||
OUT_OF_RANGE = 11, |
||||
|
||||
/// Operation is not implemented or not supported/enabled in this service.
|
||||
UNIMPLEMENTED = 12, |
||||
|
||||
/// Internal errors. Means some invariants expected by underlying System has
|
||||
/// been broken. If you see one of these errors, Something is very broken.
|
||||
INTERNAL = 13, |
||||
|
||||
/// The service is currently unavailable. This is a most likely a transient
|
||||
/// condition and may be corrected by retrying with a backoff.
|
||||
///
|
||||
/// See litmus test above for deciding between FAILED_PRECONDITION, ABORTED,
|
||||
/// and UNAVAILABLE.
|
||||
UNAVAILABLE = 14, |
||||
|
||||
/// Unrecoverable data loss or corruption.
|
||||
DATA_LOSS = 15, |
||||
|
||||
/// Force users to include a default branch:
|
||||
DO_NOT_USE = -1 |
||||
}; |
||||
|
||||
} // namespace grpc
|
||||
|
||||
#endif // GRPCXX_IMPL_CODEGEN_IMPL_STATUS_CODE_ENUM_H
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue