limiter

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 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.ITrafficLimiter, refreshInterval time.Duration, cleanupInterval time.Duration) traffic.ITrafficLimiter

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