ip_manager

package
v5.9.10 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const IPCooldownPeriod = 20 * time.Second

Variables

View Source
var ErrAllInUse = errors.Base("all IPs are in use, try again")
View Source
var ErrAllThrottled = errors.Base("all IPs are throttled")
View Source
var ErrInterruptedByUser = errors.Base("interrupted by user")
View Source
var ErrResourceLock = errors.Base("error getting next ip, did you forget to lock on the resource?")

Functions

func AllInUse

func AllInUse(ips []throttledIP) bool

AllInUse checks whether the IPs provided are all currently in use. returns false if at least one IP is not in use AND is not throttled Not thread safe, should use locking when called

func AllThrottled

func AllThrottled(ips []throttledIP) bool

AllThrottled checks whether the IPs provided are all throttled. returns false if at least one IP is not throttled Not thread safe, should use locking when called

Types

type IPPool

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

func GetIPPool

func GetIPPool(stopGrp *stop.Group) (*IPPool, error)

func (*IPPool) GetIP

func (i *IPPool) GetIP(forVideo string) (string, error)

func (*IPPool) ReleaseAll

func (i *IPPool) ReleaseAll()

func (*IPPool) ReleaseIP

func (i *IPPool) ReleaseIP(ip string)

func (*IPPool) SetThrottled

func (i *IPPool) SetThrottled(ip string)

Jump to

Keyboard shortcuts

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