ServerFeatures.swift 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. import Foundation
  17. import GRPC
  18. import NIO
  19. import NIOHTTP1
  20. /// Server features which may be required for tests.
  21. ///
  22. /// We use this enum to match up tests we can run on the NIO client against the NIO server at
  23. /// run time.
  24. ///
  25. /// These features are listed in the [gRPC interoperability test description
  26. /// specification](https://github.com/grpc/grpc/blob/master/doc/interop-test-descriptions.md).
  27. ///
  28. /// Missing features:
  29. /// - compressed response
  30. /// - compressed request
  31. /// - observe `ResponseParameter.interval_us`
  32. /// - echo authenticated username
  33. /// - echo authenticated OAuth scope
  34. ///
  35. /// - Note: This is not a complete set of features, only those used in either the client or server.
  36. public enum ServerFeature {
  37. /// See TestServiceProvider_NIO.emptyCall.
  38. case emptyCall
  39. /// See TestServiceProvider_NIO.unaryCall.
  40. case unaryCall
  41. /// See TestServiceProvider_NIO.cacheableUnaryCall.
  42. case cacheableUnaryCall
  43. /// See TestServiceProvider_NIO.streamingInputCall.
  44. case streamingInputCall
  45. /// See TestServiceProvider_NIO.streamingOutputCall.
  46. case streamingOutputCall
  47. /// See TestServiceProvider_NIO.fullDuplexCall.
  48. case fullDuplexCall
  49. /// When the client sends a `responseStatus` in the request payload, the server closes the stream
  50. /// with the status code and messsage contained within said `responseStatus`. The server will not
  51. /// process any further messages on the stream sent by the client. This can be used by clients to
  52. /// verify correct handling of different status codes and associated status messages end-to-end.
  53. case echoStatus
  54. /// When the client sends metadata with the key "x-grpc-test-echo-initial" with its request,
  55. /// the server sends back exactly this key and the corresponding value back to the client as
  56. /// part of initial metadata. When the client sends metadata with the key
  57. /// "x-grpc-test-echo-trailing-bin" with its request, the server sends back exactly this key
  58. /// and the corresponding value back to the client as trailing metadata.
  59. case echoMetadata
  60. }