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
f7f47a6d
Commit
f7f47a6d
authored
8 years ago
by
Ken Payson
Browse files
Options
Downloads
Patches
Plain Diff
Added Glossary to docs with metadata definition
parent
76c92960
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/python/grpcio/commands.py
+23
-0
23 additions, 0 deletions
src/python/grpcio/commands.py
src/python/grpcio/grpc/__init__.py
+15
-18
15 additions, 18 deletions
src/python/grpcio/grpc/__init__.py
with
38 additions
and
18 deletions
src/python/grpcio/commands.py
+
23
−
0
View file @
f7f47a6d
...
@@ -62,6 +62,26 @@ napoleon_numpy_docstring = True
...
@@ -62,6 +62,26 @@ napoleon_numpy_docstring = True
html_theme =
'
sphinx_rtd_theme
'
html_theme =
'
sphinx_rtd_theme
'
"""
"""
API_GLOSSARY
=
"""
Glossary
================
.. glossary::
metadatum
A key-value pair included in the HTTP header. It is a
2-tuple where the first entry is the key and the
second is the value, i.e. (key, value). The metadata key is an ASCII str,
and must be a valid HTTP header name. The metadata value can be
either a valid HTTP ASCII str, or bytes. If bytes are provided,
the key must end with
'
-bin
'
, i.e.
``(
'
binary-metadata-bin
'
, b
'
\\
x00
\\
xFF
'
)``
metadata
A sequence of metadatum.
"""
class
CommandError
(
Exception
):
class
CommandError
(
Exception
):
"""
Simple exception class for GRPC custom commands.
"""
"""
Simple exception class for GRPC custom commands.
"""
...
@@ -131,6 +151,9 @@ class SphinxDocumentation(setuptools.Command):
...
@@ -131,6 +151,9 @@ class SphinxDocumentation(setuptools.Command):
conf_filepath
=
os
.
path
.
join
(
'
doc
'
,
'
src
'
,
'
conf.py
'
)
conf_filepath
=
os
.
path
.
join
(
'
doc
'
,
'
src
'
,
'
conf.py
'
)
with
open
(
conf_filepath
,
'
a
'
)
as
conf_file
:
with
open
(
conf_filepath
,
'
a
'
)
as
conf_file
:
conf_file
.
write
(
CONF_PY_ADDENDUM
)
conf_file
.
write
(
CONF_PY_ADDENDUM
)
glossary_filepath
=
os
.
path
.
join
(
'
doc
'
,
'
src
'
,
'
grpc.rst
'
)
with
open
(
glossary_filepath
,
'
a
'
)
as
glossary_filepath
:
glossary_filepath
.
write
(
API_GLOSSARY
)
sphinx
.
main
([
''
,
os
.
path
.
join
(
'
doc
'
,
'
src
'
),
os
.
path
.
join
(
'
doc
'
,
'
build
'
)])
sphinx
.
main
([
''
,
os
.
path
.
join
(
'
doc
'
,
'
src
'
),
os
.
path
.
join
(
'
doc
'
,
'
build
'
)])
...
...
This diff is collapsed.
Click to expand it.
src/python/grpcio/grpc/__init__.py
+
15
−
18
View file @
f7f47a6d
...
@@ -312,7 +312,7 @@ class Call(six.with_metaclass(abc.ABCMeta, RpcContext)):
...
@@ -312,7 +312,7 @@ class Call(six.with_metaclass(abc.ABCMeta, RpcContext)):
This method blocks until the value is available.
This method blocks until the value is available.
Returns:
Returns:
The initial metadata
as a sequence of pairs of bytes
.
The initial
:term:`
metadata
`
.
"""
"""
raise
NotImplementedError
()
raise
NotImplementedError
()
...
@@ -323,7 +323,7 @@ class Call(six.with_metaclass(abc.ABCMeta, RpcContext)):
...
@@ -323,7 +323,7 @@ class Call(six.with_metaclass(abc.ABCMeta, RpcContext)):
This method blocks until the value is available.
This method blocks until the value is available.
Returns:
Returns:
The trailing metadata
as a sequence of pairs of bytes
.
The trailing
:term:`
metadata
`
.
"""
"""
raise
NotImplementedError
()
raise
NotImplementedError
()
...
@@ -394,8 +394,7 @@ class AuthMetadataPluginCallback(six.with_metaclass(abc.ABCMeta)):
...
@@ -394,8 +394,7 @@ class AuthMetadataPluginCallback(six.with_metaclass(abc.ABCMeta)):
"""
Inform the gRPC runtime of the metadata to construct a CallCredentials.
"""
Inform the gRPC runtime of the metadata to construct a CallCredentials.
Args:
Args:
metadata: An iterable of 2-sequences (e.g. tuples) of metadata key/value
metadata: The :term:`metadata` used to construct the CallCredentials.
pairs.
error: An Exception to indicate error or None to indicate success.
error: An Exception to indicate error or None to indicate success.
"""
"""
raise
NotImplementedError
()
raise
NotImplementedError
()
...
@@ -442,7 +441,7 @@ class UnaryUnaryMultiCallable(six.with_metaclass(abc.ABCMeta)):
...
@@ -442,7 +441,7 @@ class UnaryUnaryMultiCallable(six.with_metaclass(abc.ABCMeta)):
Args:
Args:
request: The request value for the RPC.
request: The request value for the RPC.
timeout: An optional duration of time in seconds to allow for the RPC.
timeout: An optional duration of time in seconds to allow for the RPC.
metadata:
An o
ptional
sequence of pairs of bytes
to be transmitted to the
metadata:
O
ptional
:term:`metadata`
to be transmitted to the
service-side of the RPC.
service-side of the RPC.
credentials: An optional CallCredentials for the RPC.
credentials: An optional CallCredentials for the RPC.
...
@@ -463,7 +462,7 @@ class UnaryUnaryMultiCallable(six.with_metaclass(abc.ABCMeta)):
...
@@ -463,7 +462,7 @@ class UnaryUnaryMultiCallable(six.with_metaclass(abc.ABCMeta)):
Args:
Args:
request: The request value for the RPC.
request: The request value for the RPC.
timeout: An optional durating of time in seconds to allow for the RPC.
timeout: An optional durating of time in seconds to allow for the RPC.
metadata:
An o
ptional
sequence of pairs of bytes
to be transmitted to the
metadata:
O
ptional
:term:`metadata`
to be transmitted to the
service-side of the RPC.
service-side of the RPC.
credentials: An optional CallCredentials for the RPC.
credentials: An optional CallCredentials for the RPC.
...
@@ -484,7 +483,7 @@ class UnaryUnaryMultiCallable(six.with_metaclass(abc.ABCMeta)):
...
@@ -484,7 +483,7 @@ class UnaryUnaryMultiCallable(six.with_metaclass(abc.ABCMeta)):
Args:
Args:
request: The request value for the RPC.
request: The request value for the RPC.
timeout: An optional duration of time in seconds to allow for the RPC.
timeout: An optional duration of time in seconds to allow for the RPC.
metadata:
An o
ptional
sequence of pairs of bytes
to be transmitted to the
metadata:
O
ptional
:term:`metadata`
to be transmitted to the
service-side of the RPC.
service-side of the RPC.
credentials: An optional CallCredentials for the RPC.
credentials: An optional CallCredentials for the RPC.
...
@@ -507,7 +506,7 @@ class UnaryStreamMultiCallable(six.with_metaclass(abc.ABCMeta)):
...
@@ -507,7 +506,7 @@ class UnaryStreamMultiCallable(six.with_metaclass(abc.ABCMeta)):
Args:
Args:
request: The request value for the RPC.
request: The request value for the RPC.
timeout: An optional duration of time in seconds to allow for the RPC.
timeout: An optional duration of time in seconds to allow for the RPC.
metadata: An optional
sequence of pairs of bytes
to be transmitted to the
metadata: An optional
:term:`metadata`
to be transmitted to the
service-side of the RPC.
service-side of the RPC.
credentials: An optional CallCredentials for the RPC.
credentials: An optional CallCredentials for the RPC.
...
@@ -530,7 +529,7 @@ class StreamUnaryMultiCallable(six.with_metaclass(abc.ABCMeta)):
...
@@ -530,7 +529,7 @@ class StreamUnaryMultiCallable(six.with_metaclass(abc.ABCMeta)):
Args:
Args:
request_iterator: An iterator that yields request values for the RPC.
request_iterator: An iterator that yields request values for the RPC.
timeout: An optional duration of time in seconds to allow for the RPC.
timeout: An optional duration of time in seconds to allow for the RPC.
metadata:
An o
ptional
sequence of pairs of bytes
to be transmitted to the
metadata:
O
ptional
:term:`metadata`
to be transmitted to the
service-side of the RPC.
service-side of the RPC.
credentials: An optional CallCredentials for the RPC.
credentials: An optional CallCredentials for the RPC.
...
@@ -553,7 +552,7 @@ class StreamUnaryMultiCallable(six.with_metaclass(abc.ABCMeta)):
...
@@ -553,7 +552,7 @@ class StreamUnaryMultiCallable(six.with_metaclass(abc.ABCMeta)):
Args:
Args:
request_iterator: An iterator that yields request values for the RPC.
request_iterator: An iterator that yields request values for the RPC.
timeout: An optional duration of time in seconds to allow for the RPC.
timeout: An optional duration of time in seconds to allow for the RPC.
metadata:
An o
ptional
sequence of pairs of bytes
to be transmitted to the
metadata:
O
ptional
:term:`metadata`
to be transmitted to the
service-side of the RPC.
service-side of the RPC.
credentials: An optional CallCredentials for the RPC.
credentials: An optional CallCredentials for the RPC.
...
@@ -575,7 +574,7 @@ class StreamUnaryMultiCallable(six.with_metaclass(abc.ABCMeta)):
...
@@ -575,7 +574,7 @@ class StreamUnaryMultiCallable(six.with_metaclass(abc.ABCMeta)):
Args:
Args:
request_iterator: An iterator that yields request values for the RPC.
request_iterator: An iterator that yields request values for the RPC.
timeout: An optional duration of time in seconds to allow for the RPC.
timeout: An optional duration of time in seconds to allow for the RPC.
metadata:
An o
ptional
sequence of pairs of bytes
to be transmitted to the
metadata:
O
ptional
:term:`metadata`
to be transmitted to the
service-side of the RPC.
service-side of the RPC.
credentials: An optional CallCredentials for the RPC.
credentials: An optional CallCredentials for the RPC.
...
@@ -599,7 +598,7 @@ class StreamStreamMultiCallable(six.with_metaclass(abc.ABCMeta)):
...
@@ -599,7 +598,7 @@ class StreamStreamMultiCallable(six.with_metaclass(abc.ABCMeta)):
Args:
Args:
request_iterator: An iterator that yields request values for the RPC.
request_iterator: An iterator that yields request values for the RPC.
timeout: An optional duration of time in seconds to allow for the RPC.
timeout: An optional duration of time in seconds to allow for the RPC.
metadata:
An o
ptional
sequence of pairs of bytes
to be transmitted to the
metadata:
O
ptional
:term:`metadata`
to be transmitted to the
service-side of the RPC.
service-side of the RPC.
credentials: An optional CallCredentials for the RPC.
credentials: An optional CallCredentials for the RPC.
...
@@ -707,7 +706,7 @@ class ServicerContext(six.with_metaclass(abc.ABCMeta, RpcContext)):
...
@@ -707,7 +706,7 @@ class ServicerContext(six.with_metaclass(abc.ABCMeta, RpcContext)):
"""
Accesses the metadata from the invocation-side of the RPC.
"""
Accesses the metadata from the invocation-side of the RPC.
Returns:
Returns:
The invocation metadata
object as a sequence of pairs of bytes
.
The invocation
:term:`
metadata
`
.
"""
"""
raise
NotImplementedError
()
raise
NotImplementedError
()
...
@@ -728,8 +727,7 @@ class ServicerContext(six.with_metaclass(abc.ABCMeta, RpcContext)):
...
@@ -728,8 +727,7 @@ class ServicerContext(six.with_metaclass(abc.ABCMeta, RpcContext)):
service-side initial metadata to transmit.
service-side initial metadata to transmit.
Args:
Args:
initial_metadata: The initial metadata of the RPC as a sequence of pairs
initial_metadata: The initial :term:`metadata`.
of bytes.
"""
"""
raise
NotImplementedError
()
raise
NotImplementedError
()
...
@@ -741,8 +739,7 @@ class ServicerContext(six.with_metaclass(abc.ABCMeta, RpcContext)):
...
@@ -741,8 +739,7 @@ class ServicerContext(six.with_metaclass(abc.ABCMeta, RpcContext)):
service-side trailing metadata to transmit.
service-side trailing metadata to transmit.
Args:
Args:
trailing_metadata: The trailing metadata of the RPC as a sequence of pairs
trailing_metadata: The trailing :term:`metadata`.
of bytes.
"""
"""
raise
NotImplementedError
()
raise
NotImplementedError
()
...
@@ -815,7 +812,7 @@ class HandlerCallDetails(six.with_metaclass(abc.ABCMeta)):
...
@@ -815,7 +812,7 @@ class HandlerCallDetails(six.with_metaclass(abc.ABCMeta)):
"""
Describes an RPC that has just arrived for service.
"""
Describes an RPC that has just arrived for service.
Attributes:
Attributes:
method: The method name of the RPC.
method: The method name of the RPC.
invocation_metadata: The metadata from the invocation side of the RPC.
invocation_metadata: The
:term:`
metadata
`
from the invocation side of the RPC.
"""
"""
...
...
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