Documentation ¶
Index ¶
Constants ¶
View Source
const ( PortConfigKey = "grpc-port" GracePeriodConfigKey = "grpc-grace-period" )
View Source
const ( HealthUnknown = 0 HealthServing = 1 HealthNotServing = 2 )
View Source
const DefaultGracePeriod = 3 * time.Second
View Source
const DefaultHealthEnabled = true
View Source
const DefaultLoggingInterceptor = true
View Source
const DefaultPort = "50051"
View Source
const DefaultPrometheusInterceptor = true
View Source
const DefaultRequestIdInterceptor = true
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HealthChecker ¶ added in v0.7.0
type HealthChecker struct {
// contains filtered or unexported fields
}
func NewHealthChecker ¶ added in v0.7.0
func NewHealthChecker(db *sqlx.DB, opts ...Option) *HealthChecker
func (*HealthChecker) Check ¶ added in v0.7.0
func (s *HealthChecker) Check(ctx context.Context, req *grpc_health_v1.HealthCheckRequest) (*grpc_health_v1.HealthCheckResponse, error)
func (*HealthChecker) Watch ¶ added in v0.7.0
func (s *HealthChecker) Watch(req *grpc_health_v1.HealthCheckRequest, server grpc_health_v1.Health_WatchServer) error
type Option ¶
type Option func(*Options)
func DisableHealthServer ¶
func DisableHealthServer() Option
func DisableLoggingInterceptor ¶
func DisableLoggingInterceptor() Option
func DisablePrometheusInterceptor ¶
func DisablePrometheusInterceptor() Option
func DisableRequestIdInterceptor ¶
func DisableRequestIdInterceptor() Option
func ShutdownGracePeriod ¶
Click to show internal directories.
Click to hide internal directories.