refactor: internal package

This commit is contained in:
Anton
2023-12-04 23:40:41 +05:00
parent 05654bd6fa
commit ad79565a93
51 changed files with 39 additions and 39 deletions

19
internal/httpx/httpx.go Normal file
View File

@@ -0,0 +1,19 @@
// Package httpx provides helper functions for making HTTP requests.
package httpx
import (
"net/http"
"time"
)
var client = Client(&http.Client{Timeout: 5 * time.Second})
// Client is something that can send HTTP requests.
type Client interface {
Do(req *http.Request) (*http.Response, error)
}
// Do sends an HTTP request and returns an HTTP response.
func Do(req *http.Request) (*http.Response, error) {
return client.Do(req)
}