limits

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Limiter

type Limiter[K huago.KeyAble] struct {
	// contains filtered or unexported fields
}

func NewLimiter

func NewLimiter[K huago.KeyAble]() *Limiter[K]

func (*Limiter[K]) Add

func (l *Limiter[K]) Add(key K, val int)

func (*Limiter[K]) Check

func (l *Limiter[K]) Check(key K) bool

func (*Limiter[K]) Clean

func (l *Limiter[K]) Clean()

func (*Limiter[K]) Del

func (l *Limiter[K]) Del(key K)

func (*Limiter[K]) Get

func (l *Limiter[K]) Get(key K) int

func (*Limiter[K]) Release

func (l *Limiter[K]) Release(key K)

func (*Limiter[K]) Set

func (l *Limiter[K]) Set(key K, val int)

func (*Limiter[K]) Sub

func (l *Limiter[K]) Sub(key K, val int)

type Unilimiter

type Unilimiter[K huago.KeyAble] struct {
	// contains filtered or unexported fields
}

Unilimiter UniLimiter 唯一限制器 单 goroutine 限制访问

func NewUnilimiter

func NewUnilimiter[K huago.KeyAble]() *Unilimiter[K]

func (*Unilimiter[K]) Check

func (l *Unilimiter[K]) Check(key K) bool

func (*Unilimiter[K]) Release

func (l *Unilimiter[K]) Release(key K)

Jump to

Keyboard shortcuts

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