globalrl

package
v0.0.0-...-9648343 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2021 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package globalrl implements global rate limiting for the Twitch Message Interface. It covers both rate limiting of channel management as well as message output.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Limiter

type Limiter struct {
	// contains filtered or unexported fields
}

Limiter is a global rate limiter

func New

func New(per30 int) *Limiter

New creates a new Limiter with a sensible rate based on the per-30-second limits set by Twitch.

func (*Limiter) Block

func (l *Limiter) Block()

Block waits until a token is available.

func (*Limiter) Limit

func (l *Limiter) Limit(iv time.Duration, capa int)

Limit changes the refill rate and capacity.

Jump to

Keyboard shortcuts

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