limiter

package
v0.1.10 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCachedTrafficLimiter

func NewCachedTrafficLimiter(limiter traffic.TrafficLimiter, ttl time.Duration, cleanupInterval time.Duration) traffic.TrafficLimiter

Types

type Cache

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

func NewCache

func NewCache(cleanupInterval time.Duration) *Cache

func (*Cache) Get

func (c *Cache) Get(key string) *Item

func (*Cache) Set

func (c *Cache) Set(key string, item *Item)

type Item

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

func NewItem

func NewItem(v interface{}, d time.Duration) *Item

func (*Item) Expired

func (p *Item) Expired() bool

func (*Item) Value

func (p *Item) Value() interface{}

Jump to

Keyboard shortcuts

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