Versions in this module Expand all Collapse all v1 v1.2.2 Sep 13, 2024 Changes in this version + const DefaultHTTPTimeout + var ErrCacheMiss = errors.New("cached asset does not exist") + var ErrCacheRoot = errors.New("failed to create cache root") + var ErrCopy = errors.New("failed to copy body") + var ErrFileOpen = errors.New("failed to open file") + var ErrGzipOpen = errors.New("failed to open gzip file") + var ErrRateLimit = errors.New("rate limiter error") + var ErrRequestCreate = errors.New("failed to create request") + var ErrRequestPerform = errors.New("failed to perform request") + var ErrResponseCSS = errors.New("failed to write css body") + var ErrResponseDecode = errors.New("failed to decode response") + var ErrResponseFormat = errors.New("failed to format body") + var ErrResponseJSON = errors.New("failed to generate json response") + var ErrResponseRead = errors.New("failed to read response body") + var ErrResponseTokenize = errors.New("failed to tokenize json body") + var ErrStat = errors.New("failed to stat cached copy") + var ErrWriteCache = errors.New("failed to write cache") + type Client struct + MaxAge time.Duration + func New(proxyProvider ProxyProvider, cache *FilesystemCache) *Client + func NewETF2LClient(proxyProvider ProxyProvider, cache *FilesystemCache) *Client + func NewLogsTFClient(proxyProvider ProxyProvider, cache *FilesystemCache) *Client + func NewRGLClient(proxyProvider ProxyProvider, cache *FilesystemCache) *Client + func NewRateLimit(proxyProvider ProxyProvider, cache *FilesystemCache, limiter *rate.Limiter) *Client + func NewSteamClient(proxyProvider ProxyProvider, keys []string, cache *FilesystemCache) *Client + func NewWithOpts(opts HTTPClientOpts) *Client + func (c *Client) Client() *http.Client + func (c *Client) Do(req *http.Request) (*http.Response, error) + func (c *Client) ProxyError(err error) bool + func (c *Client) SetRate(limiter *rate.Limiter) + func (c *Client) Transport() *http.Transport + func (c *Client) Wait(ctx context.Context) error + type FilesystemCache struct + func NewFilesystemCache(root Location) *FilesystemCache + func (f FilesystemCache) Read(url string) (io.Reader, error) + func (f FilesystemCache) ReadWithExpiration(url string, maxTime time.Duration) (io.Reader, error) + func (f FilesystemCache) Write(url string, reader io.Reader) error + type HTTPClientOpts struct + type HTTPExecutor interface + Client func() *http.Client + Do func(req *http.Request) (*http.Response, error) + ProxyError func(err error) bool + Transport func() *http.Transport + Wait func(ctx context.Context) error + type Location string + const LocationETF2L + const LocationGeneral + const LocationLogsTF + const LocationRGL + const LocationSourcebans + const LocationSteam + type NullProxyManger struct + func (n *NullProxyManger) Disconnect() + type ProxyConfig struct + LocalAddr string + RemoteAddr string + Username string + type ProxyManager struct + func NewProxyManager(privateKey string, keyPassphrase string, proxyConfigs []ProxyConfig) (*ProxyManager, error) + func (p *ProxyManager) Connect(ctx context.Context) + func (p *ProxyManager) Disconnect() + func (p *ProxyManager) Start(ctx context.Context) + type ProxyProvider interface + Disconnect func() + type QueryValueRotatorFunc func(r *http.Request)