Initial commit

This commit is contained in:
Aynakeya
2022-06-21 13:02:22 -07:00
commit 9f75839ebc
161 changed files with 18766 additions and 0 deletions

29
provider/http.go Normal file
View File

@@ -0,0 +1,29 @@
package provider
import (
"github.com/go-resty/resty/v2"
"time"
)
func httpGet(url string, header map[string]string) (*resty.Response, error) {
resp, err := resty.New().
SetTimeout(time.Second * 3).R().
SetHeaders(header).
Get(url)
return resp, err
}
func httpGetString(url string, header map[string]string) string {
resp, err := httpGet(url, header)
if err != nil {
return ""
}
return resp.String()
}
func httpHead(url string, header map[string]string) (*resty.Response, error) {
resp, err := resty.New().
SetTimeout(time.Second * 3).R().
SetHeaders(header).
Head(url)
return resp, err
}