Documentation
¶
Index ¶
- type Client
- type Server
- func (s *Server) Check(ctx context.Context, in *healthpb.HealthCheckRequest) (*healthpb.HealthCheckResponse, error)
- func (s *Server) SetServingStatus(servingStatus healthpb.HealthCheckResponse_ServingStatus)
- func (s *Server) Watch(in *healthpb.HealthCheckRequest, stream healthpb.Health_WatchServer) error
- type ServerOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements client Health.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server implements service Health.
func NewServer ¶
func NewServer(service string, opts ...ServerOption) *Server
NewServer returns a health Server.
func (*Server) Check ¶
func (s *Server) Check(ctx context.Context, in *healthpb.HealthCheckRequest) (*healthpb.HealthCheckResponse, error)
Check implements `service Health`.
func (*Server) SetServingStatus ¶
func (s *Server) SetServingStatus(servingStatus healthpb.HealthCheckResponse_ServingStatus)
SetServingStatus is called when need to reset the serving status of a service or insert a new service entry into the statusMap.
func (*Server) Watch ¶
func (s *Server) Watch(in *healthpb.HealthCheckRequest, stream healthpb.Health_WatchServer) error
Watch implements `service Health`.
type ServerOption ¶
type ServerOption func(*serverOptions)
ServerOption is server option
func WithChecksFunc ¶
func WithChecksFunc(checksFunc func() healthpb.HealthCheckResponse_ServingStatus) ServerOption
WithChecksFunc set checks function
func WithRegularInterval ¶
func WithRegularInterval(d time.Duration) ServerOption
WithRegularInterval set checking health interval
Click to show internal directories.
Click to hide internal directories.