Documentation
¶
Overview ¶
package service 框架启动的各种服务
Index ¶
- func AppendService(s ServiceBase) error
- type GRPCHealthService
- func (v GRPCHealthService) Check(ctx context.Context, req *pb.HealthCheckRequest) (*pb.HealthCheckResponse, error)
- func (v GRPCHealthService) RegisterServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func (v GRPCHealthService) RegisterServiceServer(server *grpc.Server)
- func (v GRPCHealthService) Watch(req *pb.HealthCheckRequest, hw pb.Health_WatchServer) error
- type ServiceBase
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GRPCHealthService ¶
type GRPCHealthService struct{}
GRPCHealthService 响应consul健康检查的健康服务。 并且实现了 protobuf 的 HealthServer 接口
func GetGRPCHealthService ¶
func GetGRPCHealthService() *GRPCHealthService
func (GRPCHealthService) Check ¶
func (v GRPCHealthService) Check(ctx context.Context, req *pb.HealthCheckRequest) (*pb.HealthCheckResponse, error)
func (GRPCHealthService) RegisterServiceHandlerFromEndpoint ¶
func (v GRPCHealthService) RegisterServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
func (GRPCHealthService) RegisterServiceServer ¶
func (v GRPCHealthService) RegisterServiceServer(server *grpc.Server)
///////////////////////
func (GRPCHealthService) Watch ¶
func (v GRPCHealthService) Watch(req *pb.HealthCheckRequest, hw pb.Health_WatchServer) error
type ServiceBase ¶
type ServiceBase interface { // RegisterServiceServer 注册一个服务 RegisterServiceServer(server *grpc.Server) // RegisterServiceHandlerFromEndpoint 注册一个gRPC网关服务 RegisterServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) }
ServiceBase 服务需要实现的接口
Click to show internal directories.
Click to hide internal directories.