Documentation ¶
Index ¶
- Constants
- Variables
- type Client
- 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
- type FilesystemCache
- type HTTPClientOpts
- type HTTPExecutor
- type Location
- type NullProxyManger
- type ProxyConfig
- type ProxyManager
- type ProxyProvider
- type QueryValueRotatorFunc
Constants ¶
View Source
const (
DefaultHTTPTimeout = time.Second * 15
)
Variables ¶
View Source
var ( ErrCacheRoot = errors.New("failed to create cache root") ErrWriteCache = errors.New("failed to write cache") ErrCacheMiss = errors.New("cached asset does not exist") ErrFileOpen = errors.New("failed to open file") ErrGzipOpen = errors.New("failed to open gzip file") ErrCopy = errors.New("failed to copy body") ErrStat = errors.New("failed to stat cached copy") )
View Source
var ( ErrRequestCreate = errors.New("failed to create request") ErrRequestPerform = errors.New("failed to perform request") ErrResponseRead = errors.New("failed to read response body") ErrResponseDecode = errors.New("failed to decode response") ErrResponseJSON = errors.New("failed to generate json response") ErrResponseTokenize = errors.New("failed to tokenize json body") ErrResponseCSS = errors.New("failed to write css body") ErrResponseFormat = errors.New("failed to format body") ErrRateLimit = errors.New("rate limiter error") )
Functions ¶
This section is empty.
Types ¶
type Client ¶
func New ¶
func New(proxyProvider ProxyProvider, cache *FilesystemCache) *Client
func NewETF2LClient ¶
func NewETF2LClient(proxyProvider ProxyProvider, cache *FilesystemCache) *Client
func NewLogsTFClient ¶
func NewLogsTFClient(proxyProvider ProxyProvider, cache *FilesystemCache) *Client
func NewRGLClient ¶
func NewRGLClient(proxyProvider ProxyProvider, cache *FilesystemCache) *Client
func NewRateLimit ¶
func NewRateLimit(proxyProvider ProxyProvider, cache *FilesystemCache, limiter *rate.Limiter) *Client
func NewSteamClient ¶
func NewSteamClient(proxyProvider ProxyProvider, keys []string, cache *FilesystemCache) *Client
func NewWithOpts ¶
func NewWithOpts(opts HTTPClientOpts) *Client
func (*Client) Do ¶
Do implements the same interface as http.Client. The response body *must* be closed by the caller, this is not handled automatically.
func (*Client) ProxyError ¶
type FilesystemCache ¶
type FilesystemCache struct {
// contains filtered or unexported fields
}
func NewFilesystemCache ¶
func NewFilesystemCache(root Location) *FilesystemCache
func (FilesystemCache) ReadWithExpiration ¶
type HTTPClientOpts ¶
type HTTPClientOpts struct {
// contains filtered or unexported fields
}
type HTTPExecutor ¶
type NullProxyManger ¶
type NullProxyManger struct{}
NullProxyManger implements an empty ProxyProvider for when proxies are disabled.
func (*NullProxyManger) Disconnect ¶
func (n *NullProxyManger) Disconnect()
type ProxyConfig ¶
type ProxyManager ¶
type ProxyManager struct {
// contains filtered or unexported fields
}
ProxyManager handles establishing SSH socks5 tunnel connections and giving out proxy address for HTTP clients to use.
func NewProxyManager ¶
func NewProxyManager(privateKey string, keyPassphrase string, proxyConfigs []ProxyConfig) (*ProxyManager, error)
func (*ProxyManager) Connect ¶
func (p *ProxyManager) Connect(ctx context.Context)
func (*ProxyManager) Disconnect ¶
func (p *ProxyManager) Disconnect()
func (*ProxyManager) Start ¶
func (p *ProxyManager) Start(ctx context.Context)
type ProxyProvider ¶
type ProxyProvider interface { Disconnect() // contains filtered or unexported methods }
type QueryValueRotatorFunc ¶
Click to show internal directories.
Click to hide internal directories.