pool

package
v0.0.0-...-ae88a46 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Factory

type Factory func(string) (*proxy.Proxy, error)

Factory the generator to creat Proxy

type Pool

type Pool interface {
	// Get returns a new Proxy from the pool.
	Get(string) (*proxy.Proxy, error)

	// Put Reseting the Proxy puts it back to the Pool.
	Put(*proxy.Proxy) error

	// Close closes the pool and all its connections. After Close() the pool is
	// no longer usable.
	Close()

	// Len returns the current number of connections of the pool.
	Len() int
}

Pool interface ... this interface ref to: https://github.com/fatih/pool/blob/master/pool.go

func NewChanPool

func NewChanPool(initialCap, maxCap int, factory Factory) (Pool, error)

NewChanPool to new a pool with some params

type Proxier

type Proxier interface {
	ServeHTTP(ctx *fasthttp.RequestCtx)
	// ?
	SetClient(addr string) Proxier

	// Reset .
	Reset()

	// Close .
	Close()
}

Proxier can be HTTP or WebSocket proxier TODO:

Jump to

Keyboard shortcuts

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