algorithm

package
v0.0.0-...-21f8c35 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package algorithm contains all rate limiting algorithms that define the Strategy interface

Package algorithm contains all rate limiting algorithms that define the Strategy interface

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(algorithm string, client *redis.Client, now func() time.Time) (interfaces.Strategy, error)

New function instantiates a new usecase

Types

type FixedWindow

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

FixedWindow strategy

func (*FixedWindow) Run

Run function implements the fixed window rate limiter logic

type RollingWindow

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

RollingWindow strategy

func (*RollingWindow) Run

Run function implements the fixed window rate limiter logic

Jump to

Keyboard shortcuts

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