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 (*IPPool) ReleaseAll ¶
func (i *IPPool) ReleaseAll()
func (*IPPool) SetThrottled ¶
Click to show internal directories.
Click to hide internal directories.