Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dialer ¶
func NewCreateSOCKS5Dialer ¶ added in v0.6.1
NewCreateSOCKS5Dialer creates a Dialer that routes connections via a SOCKS5 proxy. socks5ProxyURLStr should be of the form: socks5://user:pass@host:port
type InFlightConns ¶
type InFlightConns struct {
// contains filtered or unexported fields
}
func NewInFlightConns ¶
func NewInFlightConns() (*InFlightConns, error)
func (*InFlightConns) Add ¶
func (i *InFlightConns) Add(conn net.Conn)
func (*InFlightConns) Close ¶
func (i *InFlightConns) Close() error
func (*InFlightConns) Remove ¶
func (i *InFlightConns) Remove(conn net.Conn)
type OneTimePool ¶
type OneTimePool struct {
InFlightConns *InFlightConns
Dialer Dialer
// contains filtered or unexported fields
}
OneTimePool is a pool designed to create continous bare connections that are for one time only usage
func NewOneTimePool ¶
func (*OneTimePool) Close ¶
func (p *OneTimePool) Close() error
func (*OneTimePool) Run ¶
func (p *OneTimePool) Run() error
Run dials connections and keeps the pool filled until the pool is closed or its context is done, then returns an error wrapping the context's error (match it with errors.Is). Failed dials are retried with an exponentially growing wait, capped at maxDialBackoff and reset by the next successful dial, so an unreachable target does not consume a CPU core. Dial errors are not reported; callers observe them as Acquire blocking until its own context is done.
type Option ¶ added in v0.6.1
type Option func(*OneTimePool) error
Option configures OneTimePool at construction time.
func WithDialer ¶ added in v0.6.1
WithDialer sets a custom Dialer used by the pool to establish connections.