mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-08-17 21:38:03 +08:00
Extract grpcio plugins (#13896)
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
version = "1.*"
|
||||
upstream_repository = "https://github.com/grpc/grpc"
|
||||
requires = ["types-grpcio", "types-protobuf"]
|
||||
@@ -0,0 +1,35 @@
|
||||
from _typeshed import Incomplete
|
||||
from collections.abc import Callable
|
||||
from concurrent import futures
|
||||
from typing import Final, overload
|
||||
from typing_extensions import Self
|
||||
|
||||
from grpc import ServicerContext
|
||||
from grpc_health.v1 import health_pb2, health_pb2_grpc
|
||||
|
||||
SERVICE_NAME: Final[str]
|
||||
OVERALL_HEALTH: Final[str]
|
||||
|
||||
class _Watcher:
|
||||
def __init__(self) -> None: ...
|
||||
def __iter__(self) -> Self: ...
|
||||
def next(self) -> health_pb2.HealthCheckResponse: ...
|
||||
def __next__(self) -> health_pb2.HealthCheckResponse: ...
|
||||
def add(self, response: health_pb2.HealthCheckResponse) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
|
||||
class HealthServicer(health_pb2_grpc.HealthServicer):
|
||||
def __init__(
|
||||
self, experimental_non_blocking: bool = True, experimental_thread_pool: futures.ThreadPoolExecutor | None = None
|
||||
) -> None: ...
|
||||
def Check(self, request: health_pb2.HealthCheckRequest, context: ServicerContext) -> health_pb2.HealthCheckResponse: ...
|
||||
@overload
|
||||
def Watch(
|
||||
self, request: health_pb2.HealthCheckRequest, context: ServicerContext, send_response_callback: None = None
|
||||
) -> _Watcher: ...
|
||||
@overload
|
||||
def Watch(
|
||||
self, request: health_pb2.HealthCheckRequest, context: ServicerContext, send_response_callback: Callable[..., Incomplete]
|
||||
) -> None: ...
|
||||
def set(self, service: str, status: health_pb2.HealthCheckResponse.ServingStatus) -> None: ...
|
||||
def enter_graceful_shutdown(self) -> None: ...
|
||||
@@ -0,0 +1,26 @@
|
||||
from _typeshed import Incomplete
|
||||
from typing import ClassVar, final
|
||||
|
||||
from google._upb._message import Descriptor, FileDescriptor, MessageMeta
|
||||
from google.protobuf import message
|
||||
|
||||
DESCRIPTOR: FileDescriptor
|
||||
|
||||
@final
|
||||
class HealthCheckRequest(message.Message, metaclass=MessageMeta):
|
||||
SERVICE_FIELD_NUMBER: ClassVar[int]
|
||||
service: str
|
||||
def __init__(self, service: str | None = ...) -> None: ...
|
||||
DESCRIPTOR: Descriptor
|
||||
|
||||
@final
|
||||
class HealthCheckResponse(message.Message, metaclass=MessageMeta):
|
||||
ServingStatus: Incomplete
|
||||
UNKNOWN: Incomplete
|
||||
SERVING: Incomplete
|
||||
NOT_SERVING: Incomplete
|
||||
SERVICE_UNKNOWN: Incomplete
|
||||
STATUS_FIELD_NUMBER: ClassVar[int]
|
||||
status: Incomplete
|
||||
def __init__(self, status: Incomplete | str | None = ...) -> None: ...
|
||||
DESCRIPTOR: Descriptor
|
||||
@@ -0,0 +1,41 @@
|
||||
from typing import Final
|
||||
|
||||
GRPC_GENERATED_VERSION: Final[str]
|
||||
GRPC_VERSION: Final[str]
|
||||
|
||||
class HealthStub:
|
||||
def __init__(self, channel) -> None: ...
|
||||
|
||||
class HealthServicer:
|
||||
def Check(self, request, context): ...
|
||||
def Watch(self, request, context): ...
|
||||
|
||||
def add_HealthServicer_to_server(servicer, server) -> None: ...
|
||||
|
||||
class Health:
|
||||
@staticmethod
|
||||
def Check(
|
||||
request,
|
||||
target,
|
||||
options=(),
|
||||
channel_credentials=None,
|
||||
call_credentials=None,
|
||||
insecure=False,
|
||||
compression=None,
|
||||
wait_for_ready=None,
|
||||
timeout=None,
|
||||
metadata=None,
|
||||
): ...
|
||||
@staticmethod
|
||||
def Watch(
|
||||
request,
|
||||
target,
|
||||
options=(),
|
||||
channel_credentials=None,
|
||||
call_credentials=None,
|
||||
insecure=False,
|
||||
compression=None,
|
||||
wait_for_ready=None,
|
||||
timeout=None,
|
||||
metadata=None,
|
||||
): ...
|
||||
Reference in New Issue
Block a user