cache

package
v0.11.7 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const RATE_LIMITE_CACHE_KEY = "TOTOVAL_RATE_LIMIT_%s"
View Source
const RATE_LIMITE_TIMER_CACHE_KEY = "TOTOVAL_RATE_LIMIT_%s_TIMER"

Variables

This section is empty.

Functions

func Cache

func Cache() cacher

func Initialize

func Initialize()

func Store

func Store(store string) cacher

Types

type RateLimit added in v0.3.1

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

func NewRateLimit added in v0.3.1

func NewRateLimit(cache cacher) *RateLimit

func (*RateLimit) Attempts added in v0.3.1

func (rl *RateLimit) Attempts(key string) int64

func (*RateLimit) AvailableIn added in v0.3.1

func (rl *RateLimit) AvailableIn(key string) zone.Duration

func (*RateLimit) Clear added in v0.3.1

func (rl *RateLimit) Clear(key string)

func (*RateLimit) Hit added in v0.3.1

func (rl *RateLimit) Hit(key string, decayMinutes int) int64

func (*RateLimit) ResetAttempts added in v0.3.1

func (rl *RateLimit) ResetAttempts(key string) bool

func (*RateLimit) RetriesLeft added in v0.3.1

func (rl *RateLimit) RetriesLeft(key string, maxAttempts int64) int64

func (*RateLimit) TooManyAttempts added in v0.3.1

func (rl *RateLimit) TooManyAttempts(key string, maxAttempts int64) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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