This commit is contained in:
2023-12-21 22:56:24 +03:00
parent 85a42dc405
commit 0bebf8ba8a
7 changed files with 111 additions and 11 deletions

View File

@ -1,17 +1,25 @@
package plati
import "net/http"
import (
"math/rand"
"net/http"
)
type Client struct {
httpCli *http.Client
httpClis []*http.Client
token string
sellerID int
}
func New() *Client {
func New(clients []*http.Client) *Client {
return &Client{
httpCli: &http.Client{},
httpClis: clients,
token: "7C731D89FED84B479B89F24F81BB8AF2",
sellerID: 1209592,
}
}
func (c *Client) httpCli() *http.Client {
i := rand.Intn(len(c.httpClis))
return c.httpClis[i]
}