Documentation ¶
Index ¶
- type Client
- func (client *Client) AddAuthorizedIP(ip net.IP) error
- func (client *Client) AddAuthorizedIPs(ips []net.IP) error
- func (client *Client) Authenticate() error
- func (client *Client) GetAuthorizedIPs() ([]net.IP, error)
- func (client *Client) GetOwnedPublicIP() (net.IP, error)
- func (client *Client) GetProxies() ([]*Proxy, error)
- func (client *Client) RemoveAuthorizedIP(ip net.IP) error
- func (client *Client) RemoveAuthorizedIPs(ips []net.IP) error
- func (client *Client) SetAuthorizedIPs(ips []net.IP) error
- func (client *Client) TestOwnedProxies() ([]bool, error)
- func (client *Client) TestProxies(proxies []*Proxy) []bool
- type FakeServer
- type MockHTTPClient
- type Proxy
- type Result
- type SimpleHTTPClient
- type Task
- type WorkerPool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { UserName string Password string Endpoint string // contains filtered or unexported fields }
func (*Client) Authenticate ¶
func (*Client) GetProxies ¶
func (*Client) TestOwnedProxies ¶
func (*Client) TestProxies ¶
type FakeServer ¶
func NewFakeServer ¶
func NewFakeServer(port int, authIPs []net.IP) *FakeServer
func (*FakeServer) ServeForever ¶
func (server *FakeServer) ServeForever()
ServeForever starts the server in the caller routine and blocks until Stop is called
func (*FakeServer) StartServing ¶
func (server *FakeServer) StartServing()
StartServing starts the server in another go routine and return immediately
type MockHTTPClient ¶
type MockHTTPClient struct {
// contains filtered or unexported fields
}
type Proxy ¶
func MakeProxies ¶
type SimpleHTTPClient ¶
type WorkerPool ¶
type WorkerPool[T any] struct { // contains filtered or unexported fields }
func NewWorkerPool ¶
func NewWorkerPool[T any](count int) *WorkerPool[T]
func (*WorkerPool[T]) Close ¶
func (pool *WorkerPool[T]) Close()
Close the worker pool Tasks can no longer be submitted This function must be explicitly called before Wait
func (WorkerPool[T]) ResultErrors ¶
func (pool WorkerPool[T]) ResultErrors() []error
func (WorkerPool[T]) ResultValues ¶
func (pool WorkerPool[T]) ResultValues() []T
func (WorkerPool[T]) Results ¶
func (pool WorkerPool[T]) Results() []*Result[T]
Results prevents accessing to the underlying result array while it still not completed
func (*WorkerPool[T]) Submit ¶
func (pool *WorkerPool[T]) Submit(f func() (T, error))
Submit a new task for execution
func (*WorkerPool[T]) Wait ¶
func (pool *WorkerPool[T]) Wait() []*Result[T]
Wait blocks until all tasks are finished and the results are collected
Click to show internal directories.
Click to hide internal directories.