Documentation ¶
Index ¶
- func DefaultProxyOpt(cc *grpc.ClientConn) grpc.ServerOption
- func NewProxy(dst *grpc.ClientConn, opts ...grpc.ServerOption) *grpc.Server
- func RegisterService(server *grpc.Server, director StreamDirector, serviceName string, ...)
- func TransparentHandler(director StreamDirector) grpc.StreamHandler
- type StreamDirector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultProxyOpt ¶
func DefaultProxyOpt(cc *grpc.ClientConn) grpc.ServerOption
func NewProxy ¶
func NewProxy(dst *grpc.ClientConn, opts ...grpc.ServerOption) *grpc.Server
func RegisterService ¶
func RegisterService(server *grpc.Server, director StreamDirector, serviceName string, methodNames ...string)
RegisterService 注册代理服务
func TransparentHandler ¶
func TransparentHandler(director StreamDirector) grpc.StreamHandler
TransparentHandler 提供一个透明代理的方式,将未知的服务请求转发到后端服务,返回处理程序可以作为grpc.UnknownServiceHandler使用
Types ¶
type StreamDirector ¶
type StreamDirector func(ctx context.Context, fullMethodName string) (context.Context, *grpc.ClientConn, error)
func DefaultDirector ¶
func DefaultDirector(cc *grpc.ClientConn) StreamDirector
Click to show internal directories.
Click to hide internal directories.