Interceptors¶
The grpc_proxy.interceptors
contains classes and functions:
- class grpc_proxy.interceptors.ProxyInterceptor(*args: Any, **kwargs: Any)[source]¶
gRPC interceptor for initialise proxy.
- grpc_proxy.interceptors.proxy_method(request, context, service, method, config, options)[source]¶
Prototype for gRPC proxy method.
- Parameters
request (binary) – Binary request without deserialisation.
context (grpc._server._Context) – A gRPC service contex. For more details read https://grpc.github.io/grpc/python/grpc.html#service-side-context.
service (str) – A name of discovery service.
method (str) – A name of method in discovered service.
config (dict) – A config dictionary with all information. Must contain field ‘hosts’ and ‘loadBalancer’. If None raise GrpcProxyNoRuleError.
options (list) – A list of parameters for gRPC channel.
- Returns
Responce from the target services.
- Return type
binary