2
0

ServerFeatures.swift 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. * Copyright 2019, gRPC Authors All rights reserved.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. /// Server features which may be required for tests.
  17. ///
  18. /// We use this enum to match up tests we can run on the NIO client against the NIO server at
  19. /// run time.
  20. ///
  21. /// These features are listed in the [gRPC interoperability test description
  22. /// specification](https://github.com/grpc/grpc/blob/master/doc/interop-test-descriptions.md).
  23. ///
  24. /// Missing features:
  25. /// - compressed response
  26. /// - compressed request
  27. /// - observe `ResponseParameter.interval_us`
  28. /// - echo authenticated username
  29. /// - echo authenticated OAuth scope
  30. ///
  31. /// - Note: This is not a complete set of features, only those used in either the client or server.
  32. public enum ServerFeature {
  33. /// See TestServiceProvider_NIO.emptyCall.
  34. case emptyCall
  35. /// See TestServiceProvider_NIO.unaryCall.
  36. case unaryCall
  37. /// See TestServiceProvider_NIO.cacheableUnaryCall.
  38. case cacheableUnaryCall
  39. /// When the client sets expect_compressed to true, the server expects the client request to be
  40. /// compressed. If it's not, it fails the RPC with INVALID_ARGUMENT. Note that
  41. /// `response_compressed` is present on both SimpleRequest (unary) and StreamingOutputCallRequest
  42. /// (streaming).
  43. case compressedRequest
  44. /// When the client sets response_compressed to true, the server's response is sent back
  45. /// compressed. Note that response_compressed is present on both SimpleRequest (unary) and
  46. /// StreamingOutputCallRequest (streaming).
  47. case compressedResponse
  48. /// See TestServiceProvider_NIO.streamingInputCall.
  49. case streamingInputCall
  50. /// See TestServiceProvider_NIO.streamingOutputCall.
  51. case streamingOutputCall
  52. /// See TestServiceProvider_NIO.fullDuplexCall.
  53. case fullDuplexCall
  54. /// When the client sends a `responseStatus` in the request payload, the server closes the stream
  55. /// with the status code and messsage contained within said `responseStatus`. The server will not
  56. /// process any further messages on the stream sent by the client. This can be used by clients to
  57. /// verify correct handling of different status codes and associated status messages end-to-end.
  58. case echoStatus
  59. /// When the client sends metadata with the key "x-grpc-test-echo-initial" with its request,
  60. /// the server sends back exactly this key and the corresponding value back to the client as
  61. /// part of initial metadata. When the client sends metadata with the key
  62. /// "x-grpc-test-echo-trailing-bin" with its request, the server sends back exactly this key
  63. /// and the corresponding value back to the client as trailing metadata.
  64. case echoMetadata
  65. }