-
Notifications
You must be signed in to change notification settings - Fork 34
Add GenerateServiceMetadata option to generate descriptors
#86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Specifying `GenerateServiceMetadata=true` will have the generator output a set of descriptors for RPCs within each service. For example:
```swift
internal enum Grpc_Testing_TestServiceMetadata {
internal enum Methods {
internal static let emptyCall = Connect.MethodDescriptor(name: "EmptyCall", path: "grpc.testing.TestService/EmptyCall")
internal static let unaryCall = Connect.MethodDescriptor(name: "UnaryCall", path: "grpc.testing.TestService/UnaryCall")
internal static let failUnaryCall = Connect.MethodDescriptor(name: "FailUnaryCall", path: "grpc.testing.TestService/FailUnaryCall")
internal static let cacheableUnaryCall = Connect.MethodDescriptor(name: "CacheableUnaryCall", path: "grpc.testing.TestService/CacheableUnaryCall")
internal static let streamingOutputCall = Connect.MethodDescriptor(name: "StreamingOutputCall", path: "grpc.testing.TestService/StreamingOutputCall")
internal static let failStreamingOutputCall = Connect.MethodDescriptor(name: "FailStreamingOutputCall", path: "grpc.testing.TestService/FailStreamingOutputCall")
internal static let streamingInputCall = Connect.MethodDescriptor(name: "StreamingInputCall", path: "grpc.testing.TestService/StreamingInputCall")
internal static let fullDuplexCall = Connect.MethodDescriptor(name: "FullDuplexCall", path: "grpc.testing.TestService/FullDuplexCall")
internal static let halfDuplexCall = Connect.MethodDescriptor(name: "HalfDuplexCall", path: "grpc.testing.TestService/HalfDuplexCall")
internal static let unimplementedCall = Connect.MethodDescriptor(name: "UnimplementedCall", path: "grpc.testing.TestService/UnimplementedCall")
internal static let unimplementedStreamingOutputCall = Connect.MethodDescriptor(name: "UnimplementedStreamingOutputCall", path: "grpc.testing.TestService/UnimplementedStreamingOutputCall")
}
}
```
https://github.com/bufbuild/connect-swift/discussions/85
Collaborator
Author
|
cc @eddiekaiger |
|
This is exactly what I was hoping for 🔥 Amazing turnaround, thank you! |
bufdev
approved these changes
Jan 19, 2023
akshayjshah
approved these changes
Jan 19, 2023
akshayjshah
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall makes sense to me. Some small suggestions, but half of them may be nonsense 🤷🏽♂️
akshayjshah
approved these changes
Jan 19, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Per the discussion in https://github.com/bufbuild/connect-swift/discussions/85, this PR adds the ability to specify
GenerateServiceMetadata=trueto have the generator output a set of descriptors for RPCs within each service. For example:This config option is enabled by default.