Documentation ¶
Index ¶
- Variables
- func B2s(b []byte) string
- func CheckLink(link string) ([]string, error)
- func DecodeB64(s string) (string, error)
- func DecodeB64Bytes(s string) ([]byte, error)
- func Fastrandn(x uint32) uint32
- func GetListens(ctx context.Context, network, address string) ([]net.Listener, error)
- func IsFilePath(message string) bool
- func IsUrl(message string) bool
- func Listen(ctx context.Context, network, address string) (net.Listener, error)
- func U16toa(i uint16) string
- func UnsafeGetBytes(s string) []byte
- type Strategy
- type WorkerPool
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrRetryFailed = errors.New("all retry attempts failed")
)
Functions ¶
func DecodeB64Bytes ¶
func GetListens ¶
func IsFilePath ¶ added in v0.15.0
func UnsafeGetBytes ¶ added in v0.12.0
Types ¶
type Strategy ¶
type Strategy interface { // On performs a retry on a specific function, until it doesn't return any error. On(func() error) error }
Strategy is a way to retry on a specific function.
func ExponentialBackoff ¶
type WorkerPool ¶
type WorkerPool struct { // Function for serving server connections. WorkerFunc func(conn tunnel.Conn) error MaxWorkersCount int LogAllErrors bool MaxIdleWorkerDuration time.Duration // contains filtered or unexported fields }
WorkerPool serves incoming connections via a pool of workers in FILO order, i.e. the most recently stopped worker will serve the next incoming connection.
Such a scheme keeps CPU caches hot (in theory).
func (*WorkerPool) Start ¶
func (wp *WorkerPool) Start()
func (*WorkerPool) Stop ¶
func (wp *WorkerPool) Stop()
Click to show internal directories.
Click to hide internal directories.