shad-go/ratelimit/ratelimit.go

30 lines
568 B
Go
Raw Normal View History

2021-03-02 16:46:51 +00:00
// +build !solution
package ratelimit
import (
"context"
2021-03-05 11:06:01 +00:00
"errors"
2021-03-02 16:46:51 +00:00
"time"
)
// Limiter is precise rate limiter with context support.
type Limiter struct {
}
2021-03-05 11:06:01 +00:00
var ErrStopped = errors.New("limiter stopped")
2021-03-02 16:46:51 +00:00
// NewLimiter returns limiter that throttles rate of successful Acquire() calls
// to maxSize events at any given interval.
func NewLimiter(maxCount int, interval time.Duration) *Limiter {
panic("not implemented")
}
func (l *Limiter) Acquire(ctx context.Context) error {
panic("not implemented")
}
2021-03-05 11:06:01 +00:00
func (l *Limiter) Stop() {
panic("not implemented")
}