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 BasicHealthChecker ¶ added in v1.1.0
type BasicHealthChecker struct {
// contains filtered or unexported fields
}
func NewBasicHealthChecker ¶ added in v1.1.0
func NewBasicHealthChecker(opts ...Option) *BasicHealthChecker
func (*BasicHealthChecker) Check ¶ added in v1.1.0
func (s *BasicHealthChecker) Check(_ context.Context, req *grpc_health_v1.HealthCheckRequest) (*grpc_health_v1.HealthCheckResponse, error)
func (*BasicHealthChecker) Watch ¶ added in v1.1.0
func (s *BasicHealthChecker) Watch(_ *grpc_health_v1.HealthCheckRequest, server grpc_health_v1.Health_WatchServer) error
type MongodbHealthChecker ¶ added in v1.0.0
type MongodbHealthChecker struct {
// contains filtered or unexported fields
}
func NewMongoDBHealthChecker ¶ added in v1.0.0
func NewMongoDBHealthChecker(db *mongo.Client, opts ...Option) *MongodbHealthChecker
func (*MongodbHealthChecker) Check ¶ added in v1.0.0
func (s *MongodbHealthChecker) Check(ctx context.Context, req *grpc_health_v1.HealthCheckRequest) (*grpc_health_v1.HealthCheckResponse, error)
func (*MongodbHealthChecker) Watch ¶ added in v1.0.0
func (s *MongodbHealthChecker) Watch(_ *grpc_health_v1.HealthCheckRequest, server grpc_health_v1.Health_WatchServer) error
type MySQLHealthChecker ¶ added in v1.0.0
type MySQLHealthChecker struct {
// contains filtered or unexported fields
}
func NewMySQLHealthChecker ¶ added in v1.0.0
func NewMySQLHealthChecker(db *sqlx.DB, opts ...Option) *MySQLHealthChecker
func (*MySQLHealthChecker) Check ¶ added in v1.0.0
func (s *MySQLHealthChecker) Check(_ context.Context, req *grpc_health_v1.HealthCheckRequest) (*grpc_health_v1.HealthCheckResponse, error)
func (*MySQLHealthChecker) Watch ¶ added in v1.0.0
func (s *MySQLHealthChecker) Watch(_ *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.