Browse Source

[upd] add logs

main v0.3.7
loveckiy.ivan 2 weeks ago
parent
commit
589ee4da71
  1. 8
      http.go

8
http.go

@ -151,6 +151,7 @@ func curl_engine(ctx context.Context, method, urlc, bodyJSON string, response in
}
func AddressProxy(addressProxy, interval string) (port string, err error) {
var res interface{}
fail := color.Red("[Fail]")
urlProxy := ""
@ -163,7 +164,8 @@ func AddressProxy(addressProxy, interval string) (port string, err error) {
var portDataAPI models.Response
// запрашиваем порт у указанного прокси-сервера
urlProxy = addressProxy + "port?interval=" + interval
_, err := Curl(context.Background(), "GET", urlProxy, "", &portDataAPI, map[string]string{}, nil)
res, err = Curl(context.Background(), "GET", urlProxy, "", &portDataAPI, map[string]string{}, nil)
if err != nil {
return "", err
}
@ -171,8 +173,8 @@ func AddressProxy(addressProxy, interval string) (port string, err error) {
}
if port == "" {
err = fmt.Errorf("%s", "Port APP-service is null. Servive not running.")
fmt.Print(fail, " Port APP-service is null. Servive not running.\n")
err = fmt.Errorf("Port APP-service is null. Servive not running. (urlProxy: %s, response: %+v)", urlProxy, res)
fmt.Print(fail, err, "\n")
}
return port, err

Loading…
Cancel
Save