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.

Source Files