limiter

package
v2.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Count

type Count struct {
	Cur int
	Max int
}

func (*Count) MoveOn

func (m *Count) MoveOn() bool

func (*Count) Use

func (m *Count) Use()

type Limiter

type Limiter interface {
	Use()
	MoveOn() bool
}

func ParseLimiters

func ParseLimiters(opts map[string]string) ([]Limiter, error)

type Limiters

type Limiters []Limiter

func (Limiters) MoveOn

func (m Limiters) MoveOn() bool

func (Limiters) Use

func (m Limiters) Use()

type TTL

type TTL struct {
	TTL   time.Duration
	Until time.Time
}

func (*TTL) MoveOn

func (m *TTL) MoveOn() bool

func (*TTL) Use

func (m *TTL) Use()

Jump to

Keyboard shortcuts

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