throttle

package
v0.0.0-...-bf0a1f9 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisClient

type RedisClient struct {
	// contains filtered or unexported fields
}

RedisClient wraps the redis connection

func NewRedisClient

func NewRedisClient(addr string) *RedisClient

NewRedisClient creates a new Redis client for rate limiting

func (*RedisClient) AllowConnection

func (r *RedisClient) AllowConnection(clientID string, limit int, window time.Duration) bool

AllowConnection checks if a client is allow to send message based on rate limiting.

Jump to

Keyboard shortcuts

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