snippet/server/health-server.go

29 lines
629 B
Go

package server
import (
"context"
health "myschools.me/wodeschool/ws-base/health"
)
//Server consul心跳处理
type Health struct {
}
//Check 实现微服务接口
func (h *Health) Check(ctx context.Context, req *health.HealthCheckRequest) (*health.HealthCheckResponse, error) {
resp := &health.HealthCheckResponse{
Status: health.HealthCheckResponse_SERVING,
}
return resp, nil
}
//Watch 实现微服务接口stream
func (h *Health) Watch(req *health.HealthCheckRequest, out health.Health_WatchServer) error {
out.Send(&health.HealthCheckResponse{
Status: health.HealthCheckResponse_SERVING,
})
return nil
}