Commit 80bf69db authored by Wei Shoulin's avatar Wei Shoulin
Browse files

initial commit

parents
# Python temp files
**/__pycache__/
**/*.py~
**/*.pyc
# Python virtualenv folder
**/venv/
# IDE Project files
**/.idea/
**/.vscode/
**/*.swp
# MacOS folder attributes files
**/*.DS_Store
# Files created during testing
/_build/
test_reports.xml
**/.cache
**/.pytest_cache/
# Compiled python modules.
**/.pyc
# Setuptools distribution folder.
**/build/
**/dist/
# Code coverage
**/.coverage
# log
*.log
# Python egg metadata, regenerated from source files by setuptools.
**/*.egg-info
**/*.rdb
**/.eggs
**/_version.py
**/*.proto
# CSST DFS Base Proto library
## Introduction
This package provides proto file, code genneration....
## Installation
This library can be installed with the following command:
```bash
python setup.py install
```
# 安装 python 下的 protoc 编译器
pip install grpcio-tools
# 编译 proto 文件
python -m grpc_tools.protoc --python_out=. --grpc_python_out=. -I. helloworld.proto
python -m grpc_tools.protoc: python 下的 protoc 编译器通过 python 模块(module) 实现
--python_out=. : 编译生成处理 protobuf 相关的代码的路径, 这里生成到当前目录
--grpc_python_out=. : 编译生成处理 grpc 相关的代码的路径, 这里生成到当前目录
-I. helloworld.proto : proto 文件的路径, 这里的 proto 文件在当前目录
__version_info__ = (1, 0, 0)
__version__ = '.'.join(map(str, __version_info__))
\ No newline at end of file
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: auth/auth.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
from ..common import error_pb2 as common_dot_error__pb2
DESCRIPTOR = _descriptor.FileDescriptor(
name='auth/auth.proto',
package='dfs.auth',
syntax='proto3',
serialized_options=None,
serialized_pb=_b('\n\x0f\x61uth/auth.proto\x12\x08\x64\x66s.auth\x1a\x12\x63ommon/error.proto\":\n\x07Request\x12\x0e\n\x06userId\x18\x01 \x01(\x03\x12\x10\n\x08userName\x18\x02 \x01(\t\x12\r\n\x05token\x18\x03 \x01(\t\"H\n\x08Response\x12\x0f\n\x07success\x18\x01 \x01(\x08\x12\x1c\n\x05\x65rror\x18\x02 \x01(\x0b\x32\r.common.Error\x12\r\n\x05token\x18\x03 \x01(\t2\xc5\x01\n\x07\x41uthSrv\x12:\n\x0fMakeAccessToken\x12\x11.dfs.auth.Request\x1a\x12.dfs.auth.Response\"\x00\x12=\n\x12\x44\x65lUserAccessToken\x12\x11.dfs.auth.Request\x1a\x12.dfs.auth.Response\"\x00\x12?\n\x14GetCachedAccessToken\x12\x11.dfs.auth.Request\x1a\x12.dfs.auth.Response\"\x00\x62\x06proto3')
,
dependencies=[common_dot_error__pb2.DESCRIPTOR,])
_REQUEST = _descriptor.Descriptor(
name='Request',
full_name='dfs.auth.Request',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='userId', full_name='dfs.auth.Request.userId', index=0,
number=1, type=3, cpp_type=2, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='userName', full_name='dfs.auth.Request.userName', index=1,
number=2, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='token', full_name='dfs.auth.Request.token', index=2,
number=3, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=49,
serialized_end=107,
)
_RESPONSE = _descriptor.Descriptor(
name='Response',
full_name='dfs.auth.Response',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='success', full_name='dfs.auth.Response.success', index=0,
number=1, type=8, cpp_type=7, label=1,
has_default_value=False, default_value=False,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='error', full_name='dfs.auth.Response.error', index=1,
number=2, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='token', full_name='dfs.auth.Response.token', index=2,
number=3, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=109,
serialized_end=181,
)
_RESPONSE.fields_by_name['error'].message_type = common_dot_error__pb2._ERROR
DESCRIPTOR.message_types_by_name['Request'] = _REQUEST
DESCRIPTOR.message_types_by_name['Response'] = _RESPONSE
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
Request = _reflection.GeneratedProtocolMessageType('Request', (_message.Message,), {
'DESCRIPTOR' : _REQUEST,
'__module__' : 'auth.auth_pb2'
# @@protoc_insertion_point(class_scope:dfs.auth.Request)
})
_sym_db.RegisterMessage(Request)
Response = _reflection.GeneratedProtocolMessageType('Response', (_message.Message,), {
'DESCRIPTOR' : _RESPONSE,
'__module__' : 'auth.auth_pb2'
# @@protoc_insertion_point(class_scope:dfs.auth.Response)
})
_sym_db.RegisterMessage(Response)
_AUTHSRV = _descriptor.ServiceDescriptor(
name='AuthSrv',
full_name='dfs.auth.AuthSrv',
file=DESCRIPTOR,
index=0,
serialized_options=None,
serialized_start=184,
serialized_end=381,
methods=[
_descriptor.MethodDescriptor(
name='MakeAccessToken',
full_name='dfs.auth.AuthSrv.MakeAccessToken',
index=0,
containing_service=None,
input_type=_REQUEST,
output_type=_RESPONSE,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='DelUserAccessToken',
full_name='dfs.auth.AuthSrv.DelUserAccessToken',
index=1,
containing_service=None,
input_type=_REQUEST,
output_type=_RESPONSE,
serialized_options=None,
),
_descriptor.MethodDescriptor(
name='GetCachedAccessToken',
full_name='dfs.auth.AuthSrv.GetCachedAccessToken',
index=2,
containing_service=None,
input_type=_REQUEST,
output_type=_RESPONSE,
serialized_options=None,
),
])
_sym_db.RegisterServiceDescriptor(_AUTHSRV)
DESCRIPTOR.services_by_name['AuthSrv'] = _AUTHSRV
# @@protoc_insertion_point(module_scope)
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from . import auth_pb2 as auth_dot_auth__pb2
class AuthSrvStub(object):
# missing associated documentation comment in .proto file
pass
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.MakeAccessToken = channel.unary_unary(
'/dfs.auth.AuthSrv/MakeAccessToken',
request_serializer=auth_dot_auth__pb2.Request.SerializeToString,
response_deserializer=auth_dot_auth__pb2.Response.FromString,
)
self.DelUserAccessToken = channel.unary_unary(
'/dfs.auth.AuthSrv/DelUserAccessToken',
request_serializer=auth_dot_auth__pb2.Request.SerializeToString,
response_deserializer=auth_dot_auth__pb2.Response.FromString,
)
self.GetCachedAccessToken = channel.unary_unary(
'/dfs.auth.AuthSrv/GetCachedAccessToken',
request_serializer=auth_dot_auth__pb2.Request.SerializeToString,
response_deserializer=auth_dot_auth__pb2.Response.FromString,
)
class AuthSrvServicer(object):
# missing associated documentation comment in .proto file
pass
def MakeAccessToken(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def DelUserAccessToken(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetCachedAccessToken(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_AuthSrvServicer_to_server(servicer, server):
rpc_method_handlers = {
'MakeAccessToken': grpc.unary_unary_rpc_method_handler(
servicer.MakeAccessToken,
request_deserializer=auth_dot_auth__pb2.Request.FromString,
response_serializer=auth_dot_auth__pb2.Response.SerializeToString,
),
'DelUserAccessToken': grpc.unary_unary_rpc_method_handler(
servicer.DelUserAccessToken,
request_deserializer=auth_dot_auth__pb2.Request.FromString,
response_serializer=auth_dot_auth__pb2.Response.SerializeToString,
),
'GetCachedAccessToken': grpc.unary_unary_rpc_method_handler(
servicer.GetCachedAccessToken,
request_deserializer=auth_dot_auth__pb2.Request.FromString,
response_serializer=auth_dot_auth__pb2.Response.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'dfs.auth.AuthSrv', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: common/ephem/ephem.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
from .. import error_pb2 as common_dot_error__pb2
DESCRIPTOR = _descriptor.FileDescriptor(
name='common/ephem/ephem.proto',
package='dfs.ephem',
syntax='proto3',
serialized_options=_b('Z!cnlab.net/csst/proto/common/ephem'),
serialized_pb=_b('\n\x18\x63ommon/ephem/ephem.proto\x12\tdfs.ephem\x1a\x12\x63ommon/error.proto\":\n\x05\x45phem\x12\n\n\x02id\x18\x01 \x01(\x03\x12\n\n\x02ra\x18\x02 \x01(\x01\x12\x0b\n\x03\x64\x65\x63\x18\x03 \x01(\x01\x12\x0c\n\x04\x66lux\x18\x04 \x01(\x01\"L\n\x12SearchEphemRequest\x12\n\n\x02ra\x18\x01 \x01(\x01\x12\x0b\n\x03\x64\x65\x63\x18\x02 \x01(\x01\x12\x0e\n\x06radius\x18\x03 \x01(\x01\x12\r\n\x05limit\x18\x04 \x01(\x03\"y\n\x13SearchEphemResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\x12\x12\n\ntotalCount\x18\x02 \x01(\x05\x12\x1c\n\x05\x65rror\x18\x03 \x01(\x0b\x32\r.common.Error\x12\x1f\n\x05\x65phem\x18\x04 \x03(\x0b\x32\x10.dfs.ephem.Ephem2Y\n\x07\x45phemOp\x12N\n\x0bSearchEphem\x12\x1d.dfs.ephem.SearchEphemRequest\x1a\x1e.dfs.ephem.SearchEphemResponse\"\x00\x42#Z!cnlab.net/csst/proto/common/ephemb\x06proto3')
,
dependencies=[common_dot_error__pb2.DESCRIPTOR,])
_EPHEM = _descriptor.Descriptor(
name='Ephem',
full_name='dfs.ephem.Ephem',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='id', full_name='dfs.ephem.Ephem.id', index=0,
number=1, type=3, cpp_type=2, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='ra', full_name='dfs.ephem.Ephem.ra', index=1,
number=2, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='dec', full_name='dfs.ephem.Ephem.dec', index=2,
number=3, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='flux', full_name='dfs.ephem.Ephem.flux', index=3,
number=4, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=59,
serialized_end=117,
)
_SEARCHEPHEMREQUEST = _descriptor.Descriptor(
name='SearchEphemRequest',
full_name='dfs.ephem.SearchEphemRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='ra', full_name='dfs.ephem.SearchEphemRequest.ra', index=0,
number=1, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='dec', full_name='dfs.ephem.SearchEphemRequest.dec', index=1,
number=2, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='radius', full_name='dfs.ephem.SearchEphemRequest.radius', index=2,
number=3, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='limit', full_name='dfs.ephem.SearchEphemRequest.limit', index=3,
number=4, type=3, cpp_type=2, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=119,
serialized_end=195,
)
_SEARCHEPHEMRESPONSE = _descriptor.Descriptor(
name='SearchEphemResponse',
full_name='dfs.ephem.SearchEphemResponse',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='success', full_name='dfs.ephem.SearchEphemResponse.success', index=0,
number=1, type=8, cpp_type=7, label=1,
has_default_value=False, default_value=False,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='totalCount', full_name='dfs.ephem.SearchEphemResponse.totalCount', index=1,
number=2, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='error', full_name='dfs.ephem.SearchEphemResponse.error', index=2,
number=3, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='ephem', full_name='dfs.ephem.SearchEphemResponse.ephem', index=3,
number=4, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=197,
serialized_end=318,
)
_SEARCHEPHEMRESPONSE.fields_by_name['error'].message_type = common_dot_error__pb2._ERROR
_SEARCHEPHEMRESPONSE.fields_by_name['ephem'].message_type = _EPHEM
DESCRIPTOR.message_types_by_name['Ephem'] = _EPHEM
DESCRIPTOR.message_types_by_name['SearchEphemRequest'] = _SEARCHEPHEMREQUEST
DESCRIPTOR.message_types_by_name['SearchEphemResponse'] = _SEARCHEPHEMRESPONSE
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
Ephem = _reflection.GeneratedProtocolMessageType('Ephem', (_message.Message,), {
'DESCRIPTOR' : _EPHEM,
'__module__' : 'common.ephem.ephem_pb2'
# @@protoc_insertion_point(class_scope:dfs.ephem.Ephem)
})
_sym_db.RegisterMessage(Ephem)
SearchEphemRequest = _reflection.GeneratedProtocolMessageType('SearchEphemRequest', (_message.Message,), {
'DESCRIPTOR' : _SEARCHEPHEMREQUEST,
'__module__' : 'common.ephem.ephem_pb2'
# @@protoc_insertion_point(class_scope:dfs.ephem.SearchEphemRequest)
})
_sym_db.RegisterMessage(SearchEphemRequest)
SearchEphemResponse = _reflection.GeneratedProtocolMessageType('SearchEphemResponse', (_message.Message,), {
'DESCRIPTOR' : _SEARCHEPHEMRESPONSE,
'__module__' : 'common.ephem.ephem_pb2'
# @@protoc_insertion_point(class_scope:dfs.ephem.SearchEphemResponse)
})
_sym_db.RegisterMessage(SearchEphemResponse)
DESCRIPTOR._options = None
_EPHEMOP = _descriptor.ServiceDescriptor(
name='EphemOp',
full_name='dfs.ephem.EphemOp',
file=DESCRIPTOR,
index=0,
serialized_options=None,
serialized_start=320,
serialized_end=409,
methods=[
_descriptor.MethodDescriptor(
name='SearchEphem',
full_name='dfs.ephem.EphemOp.SearchEphem',
index=0,
containing_service=None,
input_type=_SEARCHEPHEMREQUEST,
output_type=_SEARCHEPHEMRESPONSE,
serialized_options=None,
),
])
_sym_db.RegisterServiceDescriptor(_EPHEMOP)
DESCRIPTOR.services_by_name['EphemOp'] = _EPHEMOP
# @@protoc_insertion_point(module_scope)
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from . import ephem_pb2 as common_dot_ephem_dot_ephem__pb2
class EphemOpStub(object):
# missing associated documentation comment in .proto file
pass
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.SearchEphem = channel.unary_unary(
'/dfs.ephem.EphemOp/SearchEphem',
request_serializer=common_dot_ephem_dot_ephem__pb2.SearchEphemRequest.SerializeToString,
response_deserializer=common_dot_ephem_dot_ephem__pb2.SearchEphemResponse.FromString,
)
class EphemOpServicer(object):
# missing associated documentation comment in .proto file
pass
def SearchEphem(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_EphemOpServicer_to_server(servicer, server):
rpc_method_handlers = {
'SearchEphem': grpc.unary_unary_rpc_method_handler(
servicer.SearchEphem,
request_deserializer=common_dot_ephem_dot_ephem__pb2.SearchEphemRequest.FromString,
response_serializer=common_dot_ephem_dot_ephem__pb2.SearchEphemResponse.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'dfs.ephem.EphemOp', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: common/error.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor.FileDescriptor(
name='common/error.proto',
package='common',
syntax='proto3',
serialized_options=_b('Z\033cnlab.net/csst/proto/common'),
serialized_pb=_b('\n\x12\x63ommon/error.proto\x12\x06\x63ommon\"%\n\x05\x45rror\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x0e\n\x06\x64\x65tail\x18\x02 \x01(\tB\x1dZ\x1b\x63nlab.net/csst/proto/commonb\x06proto3')
)
_ERROR = _descriptor.Descriptor(
name='Error',
full_name='common.Error',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='code', full_name='common.Error.code', index=0,
number=1, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='detail', full_name='common.Error.detail', index=1,
number=2, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=30,
serialized_end=67,
)
DESCRIPTOR.message_types_by_name['Error'] = _ERROR
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
Error = _reflection.GeneratedProtocolMessageType('Error', (_message.Message,), {
'DESCRIPTOR' : _ERROR,
'__module__' : 'common.error_pb2'
# @@protoc_insertion_point(class_scope:common.Error)
})
_sym_db.RegisterMessage(Error)
DESCRIPTOR._options = None
# @@protoc_insertion_point(module_scope)
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: common/fits_process/fits_process.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor.FileDescriptor(
name='common/fits_process/fits_process.proto',
package='dfs.fits_process',
syntax='proto3',
serialized_options=_b('Z(cnlab.net/csst/proto/common/fits_process'),
serialized_pb=_b('\n&common/fits_process/fits_process.proto\x12\x10\x64\x66s.fits_process\"0\n\rGetHeadersReq\x12\x11\n\tfile_path\x18\x01 \x01(\t\x12\x0c\n\x04type\x18\x02 \x01(\r\"}\n\x0eGetHeadersResp\x12<\n\x06values\x18\x01 \x03(\x0b\x32,.dfs.fits_process.GetHeadersResp.ValuesEntry\x1a-\n\x0bValuesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x32\x63\n\x0e\x46itsProcessSrv\x12Q\n\nGetHeaders\x12\x1f.dfs.fits_process.GetHeadersReq\x1a .dfs.fits_process.GetHeadersResp\"\x00\x42*Z(cnlab.net/csst/proto/common/fits_processb\x06proto3')
)
_GETHEADERSREQ = _descriptor.Descriptor(
name='GetHeadersReq',
full_name='dfs.fits_process.GetHeadersReq',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='file_path', full_name='dfs.fits_process.GetHeadersReq.file_path', index=0,
number=1, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='type', full_name='dfs.fits_process.GetHeadersReq.type', index=1,
number=2, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=60,
serialized_end=108,
)
_GETHEADERSRESP_VALUESENTRY = _descriptor.Descriptor(
name='ValuesEntry',
full_name='dfs.fits_process.GetHeadersResp.ValuesEntry',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='key', full_name='dfs.fits_process.GetHeadersResp.ValuesEntry.key', index=0,
number=1, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='value', full_name='dfs.fits_process.GetHeadersResp.ValuesEntry.value', index=1,
number=2, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=_b('8\001'),
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=190,
serialized_end=235,
)
_GETHEADERSRESP = _descriptor.Descriptor(
name='GetHeadersResp',
full_name='dfs.fits_process.GetHeadersResp',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='values', full_name='dfs.fits_process.GetHeadersResp.values', index=0,
number=1, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[_GETHEADERSRESP_VALUESENTRY, ],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=110,
serialized_end=235,
)
_GETHEADERSRESP_VALUESENTRY.containing_type = _GETHEADERSRESP
_GETHEADERSRESP.fields_by_name['values'].message_type = _GETHEADERSRESP_VALUESENTRY
DESCRIPTOR.message_types_by_name['GetHeadersReq'] = _GETHEADERSREQ
DESCRIPTOR.message_types_by_name['GetHeadersResp'] = _GETHEADERSRESP
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
GetHeadersReq = _reflection.GeneratedProtocolMessageType('GetHeadersReq', (_message.Message,), {
'DESCRIPTOR' : _GETHEADERSREQ,
'__module__' : 'common.fits_process.fits_process_pb2'
# @@protoc_insertion_point(class_scope:dfs.fits_process.GetHeadersReq)
})
_sym_db.RegisterMessage(GetHeadersReq)
GetHeadersResp = _reflection.GeneratedProtocolMessageType('GetHeadersResp', (_message.Message,), {
'ValuesEntry' : _reflection.GeneratedProtocolMessageType('ValuesEntry', (_message.Message,), {
'DESCRIPTOR' : _GETHEADERSRESP_VALUESENTRY,
'__module__' : 'common.fits_process.fits_process_pb2'
# @@protoc_insertion_point(class_scope:dfs.fits_process.GetHeadersResp.ValuesEntry)
})
,
'DESCRIPTOR' : _GETHEADERSRESP,
'__module__' : 'common.fits_process.fits_process_pb2'
# @@protoc_insertion_point(class_scope:dfs.fits_process.GetHeadersResp)
})
_sym_db.RegisterMessage(GetHeadersResp)
_sym_db.RegisterMessage(GetHeadersResp.ValuesEntry)
DESCRIPTOR._options = None
_GETHEADERSRESP_VALUESENTRY._options = None
_FITSPROCESSSRV = _descriptor.ServiceDescriptor(
name='FitsProcessSrv',
full_name='dfs.fits_process.FitsProcessSrv',
file=DESCRIPTOR,
index=0,
serialized_options=None,
serialized_start=237,
serialized_end=336,
methods=[
_descriptor.MethodDescriptor(
name='GetHeaders',
full_name='dfs.fits_process.FitsProcessSrv.GetHeaders',
index=0,
containing_service=None,
input_type=_GETHEADERSREQ,
output_type=_GETHEADERSRESP,
serialized_options=None,
),
])
_sym_db.RegisterServiceDescriptor(_FITSPROCESSSRV)
DESCRIPTOR.services_by_name['FitsProcessSrv'] = _FITSPROCESSSRV
# @@protoc_insertion_point(module_scope)
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from . import fits_process_pb2 as common_dot_fits__process_dot_fits__process__pb2
class FitsProcessSrvStub(object):
# missing associated documentation comment in .proto file
pass
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.GetHeaders = channel.unary_unary(
'/dfs.fits_process.FitsProcessSrv/GetHeaders',
request_serializer=common_dot_fits__process_dot_fits__process__pb2.GetHeadersReq.SerializeToString,
response_deserializer=common_dot_fits__process_dot_fits__process__pb2.GetHeadersResp.FromString,
)
class FitsProcessSrvServicer(object):
# missing associated documentation comment in .proto file
pass
def GetHeaders(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_FitsProcessSrvServicer_to_server(servicer, server):
rpc_method_handlers = {
'GetHeaders': grpc.unary_unary_rpc_method_handler(
servicer.GetHeaders,
request_deserializer=common_dot_fits__process_dot_fits__process__pb2.GetHeadersReq.FromString,
response_serializer=common_dot_fits__process_dot_fits__process__pb2.GetHeadersResp.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'dfs.fits_process.FitsProcessSrv', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
This diff is collapsed.
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from ifs.fits import fits_pb2 as ifs_dot_fits_dot_fits__pb2
class FitsSrvStub(object):
# missing associated documentation comment in .proto file
pass
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.find = channel.unary_unary(
'/ifs.fits.FitsSrv/find',
request_serializer=ifs_dot_fits_dot_fits__pb2.FindRawFitsReq.SerializeToString,
response_deserializer=ifs_dot_fits_dot_fits__pb2.FindRawFitsResp.FromString,
)
self.get = channel.unary_unary(
'/ifs.fits.FitsSrv/get',
request_serializer=ifs_dot_fits_dot_fits__pb2.GetRawFitsReq.SerializeToString,
response_deserializer=ifs_dot_fits_dot_fits__pb2.GetRawFitsResp.FromString,
)
self.read = channel.unary_stream(
'/ifs.fits.FitsSrv/read',
request_serializer=ifs_dot_fits_dot_fits__pb2.ReadRawFitsReq.SerializeToString,
response_deserializer=ifs_dot_fits_dot_fits__pb2.ReadRawFitsResp.FromString,
)
self.write = channel.stream_unary(
'/ifs.fits.FitsSrv/write',
request_serializer=ifs_dot_fits_dot_fits__pb2.WriteRawFitsReq.SerializeToString,
response_deserializer=ifs_dot_fits_dot_fits__pb2.WriteRawFitsResp.FromString,
)
self.update_qc0_status = channel.unary_unary(
'/ifs.fits.FitsSrv/update_qc0_status',
request_serializer=ifs_dot_fits_dot_fits__pb2.UpdateQc0StatusReq.SerializeToString,
response_deserializer=ifs_dot_fits_dot_fits__pb2.UpdateQc0StatusResp.FromString,
)
self.update_proc_status = channel.unary_unary(
'/ifs.fits.FitsSrv/update_proc_status',
request_serializer=ifs_dot_fits_dot_fits__pb2.UpdateProcStatusReq.SerializeToString,
response_deserializer=ifs_dot_fits_dot_fits__pb2.UpdateProcStatusResp.FromString,
)
class FitsSrvServicer(object):
# missing associated documentation comment in .proto file
pass
def find(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def get(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def read(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def write(self, request_iterator, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def update_qc0_status(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def update_proc_status(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_FitsSrvServicer_to_server(servicer, server):
rpc_method_handlers = {
'find': grpc.unary_unary_rpc_method_handler(
servicer.find,
request_deserializer=ifs_dot_fits_dot_fits__pb2.FindRawFitsReq.FromString,
response_serializer=ifs_dot_fits_dot_fits__pb2.FindRawFitsResp.SerializeToString,
),
'get': grpc.unary_unary_rpc_method_handler(
servicer.get,
request_deserializer=ifs_dot_fits_dot_fits__pb2.GetRawFitsReq.FromString,
response_serializer=ifs_dot_fits_dot_fits__pb2.GetRawFitsResp.SerializeToString,
),
'read': grpc.unary_stream_rpc_method_handler(
servicer.read,
request_deserializer=ifs_dot_fits_dot_fits__pb2.ReadRawFitsReq.FromString,
response_serializer=ifs_dot_fits_dot_fits__pb2.ReadRawFitsResp.SerializeToString,
),
'write': grpc.stream_unary_rpc_method_handler(
servicer.write,
request_deserializer=ifs_dot_fits_dot_fits__pb2.WriteRawFitsReq.FromString,
response_serializer=ifs_dot_fits_dot_fits__pb2.WriteRawFitsResp.SerializeToString,
),
'update_qc0_status': grpc.unary_unary_rpc_method_handler(
servicer.update_qc0_status,
request_deserializer=ifs_dot_fits_dot_fits__pb2.UpdateQc0StatusReq.FromString,
response_serializer=ifs_dot_fits_dot_fits__pb2.UpdateQc0StatusResp.SerializeToString,
),
'update_proc_status': grpc.unary_unary_rpc_method_handler(
servicer.update_proc_status,
request_deserializer=ifs_dot_fits_dot_fits__pb2.UpdateProcStatusReq.FromString,
response_serializer=ifs_dot_fits_dot_fits__pb2.UpdateProcStatusResp.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'ifs.fits.FitsSrv', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment