Documentation ¶
Index ¶
- Variables
- func UnaryErrorInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (resp interface{}, err error)
- type CalculatorGRPCServer
- func (server *CalculatorGRPCServer) Add(ctx context.Context, req *proto.CalculatorAddRequest) (*proto.CalculatorInt32Response, error)
- func (server *CalculatorGRPCServer) Div(ctx context.Context, req *proto.CalculatorDivRequest) (*proto.CalculatorFloatResponse, error)
- func (server *CalculatorGRPCServer) Mul(ctx context.Context, req *proto.CalculatorMulRequest) (*proto.CalculatorInt32Response, error)
- func (server *CalculatorGRPCServer) Sub(ctx context.Context, req *proto.CalculatorSubRequest) (*proto.CalculatorInt32Response, error)
- type HealthGRPCServer
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Decoder = copier.NewCopier("form", "protobuf.name") Encoder = copier.NewCopier("protobuf.name", "reply") )
Functions ¶
func UnaryErrorInterceptor ¶
func UnaryErrorInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error)
UnaryErrorInterceptor 错误拦截器。将error转为grpc错误
Types ¶
type CalculatorGRPCServer ¶
type CalculatorGRPCServer struct { AddServer transport.Handler SubServer transport.Handler MulServer transport.Handler DivServer transport.Handler }
CalculatorGRPCServer 计算器GRPC服务
func NewCalculatorGRPCServer ¶
func NewCalculatorGRPCServer(service cmd_endpoint.CalculatorService, middlewares endpoint.Middleware, options ...transport.ServerOption) *CalculatorGRPCServer
NewCalculatorGRPCServer 创建计算器GRPC服务
func (*CalculatorGRPCServer) Add ¶
func (server *CalculatorGRPCServer) Add(ctx context.Context, req *proto.CalculatorAddRequest) (*proto.CalculatorInt32Response, error)
func (*CalculatorGRPCServer) Div ¶
func (server *CalculatorGRPCServer) Div(ctx context.Context, req *proto.CalculatorDivRequest) (*proto.CalculatorFloatResponse, error)
func (*CalculatorGRPCServer) Mul ¶
func (server *CalculatorGRPCServer) Mul(ctx context.Context, req *proto.CalculatorMulRequest) (*proto.CalculatorInt32Response, error)
func (*CalculatorGRPCServer) Sub ¶
func (server *CalculatorGRPCServer) Sub(ctx context.Context, req *proto.CalculatorSubRequest) (*proto.CalculatorInt32Response, error)
type HealthGRPCServer ¶
HealthGRPCServer 健康检查GRPC服务
func NewHealthGRPCServer ¶
func NewHealthGRPCServer(service cmd_endpoint.HealthService, middlewares endpoint.Middleware, options ...transport.ServerOption) *HealthGRPCServer
NewHealthGRPCServer 创建健康检查GRPC服务
func (*HealthGRPCServer) Check ¶
func (server *HealthGRPCServer) Check(ctx context.Context, req *proto.HealthCheckRequest) (*proto.HealthCheckResponse, error)
Check 检查指定服务的健康状态
func (*HealthGRPCServer) Watch ¶
func (server *HealthGRPCServer) Watch(req *proto.HealthCheckRequest, watcher proto.Health_WatchServer) error
Watch 观察指定服务的健康状态。未实现
Click to show internal directories.
Click to hide internal directories.