Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
7be69fcc
Commit
7be69fcc
authored
8 years ago
by
Mehrdad Afshari
Browse files
Options
Downloads
Patches
Plain Diff
Add helper function for enabling python reflection
parent
9ca61fd0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/python/grpcio_reflection/grpc_reflection/v1alpha/reflection.py
+12
-0
12 additions, 0 deletions
...n/grpcio_reflection/grpc_reflection/v1alpha/reflection.py
with
12 additions
and
0 deletions
src/python/grpcio_reflection/grpc_reflection/v1alpha/reflection.py
+
12
−
0
View file @
7be69fcc
...
...
@@ -35,6 +35,7 @@ from google.protobuf import descriptor_pb2
from
google.protobuf
import
descriptor_pool
from
grpc_reflection.v1alpha
import
reflection_pb2
from
grpc_reflection.v1alpha
import
reflection_pb2_grpc
_POOL
=
descriptor_pool
.
Default
()
...
...
@@ -140,3 +141,14 @@ class ReflectionServicer(reflection_pb2.ServerReflectionServicer):
error_code
=
grpc
.
StatusCode
.
INVALID_ARGUMENT
.
value
[
0
],
error_message
=
grpc
.
StatusCode
.
INVALID_ARGUMENT
.
value
[
1
]
.
encode
(),))
def
enable_server_reflection
(
service_names
,
server
):
"""
Enables server reflection on a server.
Args:
service_names: Iterable of fully-qualified service names available.
server: grpc.Server to which reflection service will be added.
"""
reflection_pb2_grpc
.
add_ServerReflectionServicer_to_server
(
ReflectionServicer
(
service_names
),
server
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment