2022-06-08 21:17:08 -07:00
|
|
|
package databaseRest
|
2022-04-02 12:05:32 -07:00
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"io/ioutil"
|
|
|
|
"net/http"
|
|
|
|
|
|
|
|
//"github.com/jtom38/newsbot/collector/services"
|
|
|
|
)
|
|
|
|
|
|
|
|
type DiagnosisClient struct {
|
|
|
|
rootUri string
|
|
|
|
}
|
|
|
|
|
|
|
|
func (dc *DiagnosisClient) Ping() error {
|
|
|
|
dbPing := fmt.Sprintf("%v/ping", dc.rootUri)
|
|
|
|
resp, err := http.Get(dbPing)
|
|
|
|
if err != nil { return err }
|
|
|
|
|
|
|
|
_, err = ioutil.ReadAll(resp.Body)
|
|
|
|
if err != nil { return err }
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|