ratelimit

package
v2.8.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package ratelimit based on http://hustcat.github.io/rate-limit-example-in-go/

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewReader

func NewReader(r io.Reader, l *rate.Limiter) io.Reader

NewReader returns a reader that is rate limited by the given token bucket. Each token in the bucket represents one byte.

func NewWriter

func NewWriter(w io.Writer, l *rate.Limiter) io.Writer

NewWriter returns a writer that is rate limited by the given token bucket. Each token in the bucket represents one byte.

Types

This section is empty.

Jump to

Keyboard shortcuts

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