limit

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrLimit = errors.New("limit exceeded")
)

Functions

This section is empty.

Types

type Limit

type Limit interface {
	Running() int // return -1 if u donot want to implement this
	Acquire(key []byte) error
	Release(key []byte)
}

func New

func New(n int) Limit

func NewBlockingCount

func NewBlockingCount(n int) Limit

Jump to

Keyboard shortcuts

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