pool

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Code generated by go run github.com/nfx/slrp/ql/generator/main.go Foo. DO NOT EDIT.

Index

Constants

This section is empty.

Variables

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

Functions

This section is empty.

Types

type ApiEntry added in v0.1.3

type ApiEntry struct {
	Proxy          pmux.Proxy `facet:"Protocol"`
	FirstSeen      int64
	LastSeen       int64
	ReanimateAfter time.Time
	Ok             bool
	Speed          time.Duration
	Timeouts       int
	Offered        int
	Reanimated     int
	Succeed        int
	HourOffered    [24]int
	HourSucceed    [24]int
	Country        string `facet:"Country"`
	Provider       string
	ASN            uint16
}

type ApiEntryDataset added in v0.2.0

type ApiEntryDataset []ApiEntry

func (ApiEntryDataset) Query added in v0.2.0

func (d ApiEntryDataset) Query(query string) (*eval.QueryResult[ApiEntry], error)

type Card

type Card struct {
	Name  string
	Value any
}

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, ipLookup ipinfo.IpInfoGetter, dialer dialer) *Pool

func (*Pool) Add

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

func (*Pool) Configure added in v0.3.0

func (pool *Pool) Configure(c app.Config) error

func (*Pool) HttpGet

func (pool *Pool) HttpGet(r *http.Request) (any, error)

func (*Pool) Len

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

func (*Pool) MarshalBinary

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

func (*Pool) PendingEviction added in v0.3.0

func (pool *Pool) PendingEviction() []pmux.Proxy

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, httpClient) 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 []ApiEntry
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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