rate

package
v0.9.16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 12, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL