repository

package
v0.0.0-...-63c9274 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RateLimiterRepository

type RateLimiterRepository interface {
	// AddRequestCount implement redis slide windows algorithm
	// When too many request will return -1
	// ref : https://en.wikipedia.org/wiki/Sliding_window_protocol
	AddRequestCount(ctx context.Context, key string, maxCount, timeUintSecond int64) (count int64, err error)
}

RateLimiterRepository define rate limit method

func NewRateLimiterRepository

func NewRateLimiterRepository(redisClient *redis.Client) RateLimiterRepository

NewRateLimiterRepository ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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