Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APILimiter ¶
type APILimiter struct {
Name string
// contains filtered or unexported fields
}
func NewAPILimiter ¶
func NewAPILimiter(l *Definition) *APILimiter
func (*APILimiter) Release ¶
func (l *APILimiter) Release()
func (*APILimiter) String ¶
func (l *APILimiter) String() string
func (*APILimiter) TryToAcquireSemaphore ¶
func (l *APILimiter) TryToAcquireSemaphore() bool
type Definition ¶
type Definition struct {
// the limiter name
Name string
// the actual limiter config
FillRate rate.Limit
BucketSize int64
// the max concurrency supported
MaxConcurrency int64
}
func (*Definition) String ¶
func (d *Definition) String() string
func (*Definition) Validate ¶
func (d *Definition) Validate() []string
Click to show internal directories.
Click to hide internal directories.