24 lines
395 B
Go
24 lines
395 B
Go
package health
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
type GetTmobileConnCheckFunc func() (TmobileConnCheckInterface, error)
|
|
|
|
func NewTmobileCheck(fn GetTmobileConnCheckFunc) CheckFunc {
|
|
return func(ctx context.Context) error {
|
|
client, err := fn()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
err = client.Ping(ctx)
|
|
return err
|
|
}
|
|
}
|
|
|
|
type TmobileConnCheckInterface interface {
|
|
Ping(ctx context.Context) error
|
|
}
|