Documentation ¶
Index ¶
- func CallDispatch(ctx context.Context, svcName, tag string, in *protoc.DispatchReq) (*protoc.DispatchResp, error)
- func CallRaw(ctx context.Context, svcName, tag string, caller GrpcMethodCaller) (proto.Message, error)
- func CallRawRe(ctx context.Context, svcName, tag, svcGrpcName, method string, ...) error
- func GenRecoverInterceptor(handler grpc_recovery.RecoveryHandlerFunc) (grpc.UnaryServerInterceptor, grpc.StreamServerInterceptor)
- func InitModules(svcCenterAddr, jaegerAgentAddr string) error
- func RegistDispatchHander(cmd int32, handler DispatchHandler) error
- func StreamServerInterceptorAccessLog() grpc.StreamServerInterceptor
- func UnaryClientInterceptorJaeger() grpc.UnaryClientInterceptor
- func UnaryServerInterceptorAccessLog() grpc.UnaryServerInterceptor
- func UnaryServerInterceptorJaeger() grpc.UnaryServerInterceptor
- type DispatchHandler
- type GrpcMethodCaller
- type ServerInfo
- type SvcRegistFunc
- type WGrpcClient
- type WServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CallDispatch ¶
func CallDispatch(ctx context.Context, svcName, tag string, in *protoc.DispatchReq) (*protoc.DispatchResp, error)
CallDispatch call a grpc service: lb_policy = random
func CallRaw ¶
func CallRaw(ctx context.Context, svcName, tag string, caller GrpcMethodCaller) (proto.Message, error)
CallRaw generate a *grpc.ClientConn and pass to caller which make real call
func CallRawRe ¶
func CallRawRe(ctx context.Context, svcName, tag, svcGrpcName, method string, req proto.Message, resp ...proto.Message) error
CallRawRe call a grpc service: lb_policy = random
func GenRecoverInterceptor ¶
func GenRecoverInterceptor(handler grpc_recovery.RecoveryHandlerFunc) (grpc.UnaryServerInterceptor, grpc.StreamServerInterceptor)
GenRecoverInterceptor ...
func RegistDispatchHander ¶
func RegistDispatchHander(cmd int32, handler DispatchHandler) error
RegistDispatchHander regist handlers for dispatcher
func StreamServerInterceptorAccessLog ¶
func StreamServerInterceptorAccessLog() grpc.StreamServerInterceptor
StreamServerInterceptorAccessLog ...
func UnaryClientInterceptorJaeger ¶
func UnaryClientInterceptorJaeger() grpc.UnaryClientInterceptor
UnaryClientInterceptorJaeger ...
func UnaryServerInterceptorAccessLog ¶
func UnaryServerInterceptorAccessLog() grpc.UnaryServerInterceptor
UnaryServerInterceptorAccessLog ...
func UnaryServerInterceptorJaeger ¶
func UnaryServerInterceptorJaeger() grpc.UnaryServerInterceptor
UnaryServerInterceptorJaeger ...
Types ¶
type DispatchHandler ¶
type DispatchHandler func(context.Context, *protoc.RouteHeader, []byte) (*protoc.DispatchResp, error)
DispatchHandler handler for DispatchSvc
type GrpcMethodCaller ¶
GrpcMethodCaller with conn, make real call
type ServerInfo ¶
type ServerInfo struct { UniqID string Name string Host string Port int ConnTimeoutSec int Tags []string AddrConsulCenter string AddrJaegerAgent string }
ServerInfo ...
type SvcRegistFunc ¶
SvcRegistFunc in this function, we should regist services to grpc server
type WGrpcClient ¶
type WGrpcClient struct {
*grpc.ClientConn
}
type WServer ¶
WServer warpper of grpc server
func NewDispatchServer ¶
func NewDispatchServer(name, port string, register SvcRegistFunc, opt ...grpc.ServerOption) *WServer
NewDispatchServer generate a grpc server which has a service named DispatchSvc
func NewWServer ¶
func NewWServer(srv *ServerInfo, certFile, keyFile string, opt ...grpc.ServerOption) (*WServer, error)
NewWServer new instance of WServer