ratelimit

package
v0.0.0-...-76f49ba Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package ratelimit provides a rate limiter algorithm.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RequestAllowed

func RequestAllowed(clientInfo ClientInfoInterface) bool

Types

type ClientInfoInterface

type ClientInfoInterface interface {
	GetClientID() string
	GetAllowedTargetGroup() string
	GetMaxConnections() int
	GetConnections() int
	GetMaxRequestsPerWindow() int
	GetLastWindow() time.Time
	GetRequestCount() int
	SetLastWindow(now time.Time)
	IncrementRequestCount()
}

Jump to

Keyboard shortcuts

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