Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ServerLimiter ¶
type ServerLimiter struct {
// contains filtered or unexported fields
}
ServerLimiter provides interface to limit amount of requests
func NewServerLimiter ¶
func NewServerLimiter(servers []string, l int) *ServerLimiter
NewServerLimiter creates a limiter for specific servers list.
func (ServerLimiter) Capacity ¶
func (sl ServerLimiter) Capacity() int
type SimpleLimiter ¶
type SimpleLimiter chan struct{}
func NewSimpleLimiter ¶
func NewSimpleLimiter(l int) SimpleLimiter
func (SimpleLimiter) Enter ¶
func (l SimpleLimiter) Enter()
func (SimpleLimiter) Leave ¶
func (l SimpleLimiter) Leave()
Click to show internal directories.
Click to hide internal directories.