pool

package
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoProxiesLeft = fmt.Errorf("no proxies left")

Functions

This section is empty.

Types

type Card

type Card struct {
	Name  string
	Value interface{}
}

TODO: think of rather type Facet struct { Name, Field string; Values []string }

type Pool

type Pool struct {
	// contains filtered or unexported fields
}

func NewPool

func NewPool(history *history.History) *Pool

func (*Pool) Add

func (pool *Pool) Add(ctx context.Context, proxy pmux.Proxy, speed time.Duration)

func (*Pool) HttpGet

func (pool *Pool) HttpGet(r *http.Request) (interface{}, error)

func (*Pool) Len

func (pool *Pool) Len() (res int)

func (*Pool) MarshalBinary

func (pool *Pool) MarshalBinary() ([]byte, error)

func (*Pool) RandomFast

func (pool *Pool) RandomFast(ctx context.Context) context.Context

func (*Pool) Remove

func (pool *Pool) Remove(proxy pmux.Proxy) bool

func (*Pool) RoundTrip

func (pool *Pool) RoundTrip(req *http.Request) (res *http.Response, err error)

func (*Pool) Session

func (pool *Pool) Session(ctx context.Context, fn func(context.Context, *http.Client) error) error

Session rotates a random proxy per entire fn(ctx, client) call

func (*Pool) Start

func (pool *Pool) Start(ctx app.Context)

func (*Pool) UnmarshalBinary

func (pool *Pool) UnmarshalBinary(data []byte) error

type PoolStats

type PoolStats struct {
	Total   int
	Cards   []Card
	Entries []entry
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL