limitmap

package
v0.4.7 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LimitMap

type LimitMap struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func New

func New() *LimitMap

New creates new key-based stats keeper

func (*LimitMap) Dec

func (s *LimitMap) Dec(key any) int

Dec decreases counter for the given key.

func (*LimitMap) Inc

func (s *LimitMap) Inc(key any, limit int) bool

Inc increases counter for the given key. Returns false if limit reached.

func (*LimitMap) Value

func (s *LimitMap) Value(key any) int

Value returns value for the given key.

Jump to

Keyboard shortcuts

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