Documentation ¶ Index ¶ type Limiter type Option func WithDuration(duration time.Duration) Option func WithMaxLimit(maxValue int64) Option type Service func NewLimiter(driver key_value.IKeyValue, opts ...Option) *Service func (s *Service) IsAllowedByKey(ctx context.Context, rateLimitKey string) bool Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type Limiter ¶ type Limiter interface { IsAllowedByKey(ctx context.Context, rateLimitKey string) bool } type Option ¶ type Option func(service *Service) func WithDuration ¶ func WithDuration(duration time.Duration) Option func WithMaxLimit ¶ func WithMaxLimit(maxValue int64) Option type Service ¶ type Service struct { // contains filtered or unexported fields } func NewLimiter ¶ func NewLimiter(driver key_value.IKeyValue, opts ...Option) *Service func (*Service) IsAllowedByKey ¶ func (s *Service) IsAllowedByKey(ctx context.Context, rateLimitKey string) bool Source Files ¶ View all Source files options.goservice.go Click to show internal directories. Click to hide internal directories.