Documentation ¶
Index ¶
- func CheckContextStatus(ctx context.Context, name ...string) error
- func CheckHttpStatus(ctx context.Context, url string, timeout time.Duration) error
- func CheckMongoClientStatus(ctx context.Context, client *mongo.Client) error
- func CheckMongoDBStatus(ctx context.Context, connectionString string, timeoutConnect time.Duration, ...) error
- func CheckMqttClientStatus(ctx context.Context, mqttClient mqtt.Client) error
- func CheckMySQLStatus(ctx context.Context, db *sql.DB, connectionString string) error
- func CheckPingStatus(URL, Method string, Timeout int, Body io.Reader, Headers map[string]string) error
- func CheckRedisStatus(ctx context.Context, connectionString string) error
- func CheckSignalClientStatus(ctx context.Context, client signalr.Client) error
- func CheckSignalRSrvHttpStatus(ctx context.Context, address string, wcaddress string) error
- func CheckSignalRSrvStatus(ctx context.Context, address string, wcaddress string) error
- func NewContextCheck(ctx context.Context, name ...string) *contextCheck
- type HttpCheck
- type MongoClientCheck
- type MongoDbCheck
- type MqttClientCheck
- type MySQLCheck
- type PingCheck
- type RedisCheck
- type SignalClientCheck
- type SignalRSrvCheck
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckHttpStatus ¶
func CheckMongoClientStatus ¶
func CheckMongoDBStatus ¶
func CheckMqttClientStatus ¶
func CheckMySQLStatus ¶
func CheckPingStatus ¶
func CheckSignalClientStatus ¶
func CheckSignalRSrvStatus ¶
func NewContextCheck ¶
Types ¶
type HttpCheck ¶
type HttpCheck struct { // Ctx is the context that will be used for the health check. Ctx context.Context // URL is the remote service health check URL. URL string // RequestTimeout is the duration that health check will try to consume published test message. // If not set - 5 seconds RequestTimeout time.Duration Error error }
Config is the HTTP checker configuration settings container.
func NewHttpCheck ¶
func (HttpCheck) CheckStatus ¶
New creates new HTTP service health check that verifies the following: - connection establishing - getting response status from defined URL - verifying that status code is less than 500
type MongoClientCheck ¶
func NewMongoClientCheck ¶
func NewMongoClientCheck(ctx context.Context, client *mongo.Client) MongoClientCheck
func (MongoClientCheck) CheckStatus ¶
func (check MongoClientCheck) CheckStatus() error
type MongoDbCheck ¶
type MongoDbCheck struct { Ctx context.Context MongoDBClient *mongo.Client // DSN is the MongoDB instance connection DSN. Required. ConnectionString string // TimeoutConnect defines timeout for establishing mongo connection, if not set - default value is used TimeoutConnect time.Duration // TimeoutDisconnect defines timeout for closing connection, if not set - default value is used TimeoutDisconnect time.Duration // TimeoutDisconnect defines timeout for making ping request, if not set - default value is used TimeoutPing time.Duration // return the check error Error error }
Config is the MongoDB checker configuration settings container.
func NewMongoDbCheck ¶
func (MongoDbCheck) CheckStatus ¶
func (check MongoDbCheck) CheckStatus() error
type MqttClientCheck ¶
func NewMqttClientCheck ¶
func NewMqttClientCheck(ctx context.Context, mqttClient mqtt.Client) MqttClientCheck
func (MqttClientCheck) CheckStatus ¶
func (check MqttClientCheck) CheckStatus() error
type MySQLCheck ¶
func NewMySQLCheck ¶
func (*MySQLCheck) CheckStatus ¶
func (check *MySQLCheck) CheckStatus() error
func (*MySQLCheck) CheckbyConnectionString ¶
func (check *MySQLCheck) CheckbyConnectionString() error
type PingCheck ¶
type PingCheck struct { URL string Method string Timeout int Body io.Reader Headers map[string]string Error error // contains filtered or unexported fields }
func NewPingCheck ¶
type RedisCheck ¶
Config is the Redis checker configuration settings container.
func NewRedisCheck ¶
func NewRedisCheck(ctx context.Context, connectionString string) RedisCheck
func (RedisCheck) CheckStatus ¶
func (check RedisCheck) CheckStatus() error
type SignalClientCheck ¶
func NewSignalClientCheck ¶
func NewSignalClientCheck(ctx context.Context, client signalr.Client) SignalClientCheck
func (SignalClientCheck) CheckStatus ¶
func (check SignalClientCheck) CheckStatus() error
type SignalRSrvCheck ¶
type SignalRSrvCheck struct { Ctx context.Context WcAddress string ServerAddress string Error error }
func NewSignalRSrvCheck ¶
func NewSignalRSrvCheck(ctx context.Context, address string, wcaddress string) SignalRSrvCheck
func (SignalRSrvCheck) CheckStatus ¶
func (check SignalRSrvCheck) CheckStatus() error
func (SignalRSrvCheck) CheckhttpStatus ¶
func (check SignalRSrvCheck) CheckhttpStatus() error
Click to show internal directories.
Click to hide internal directories.