ratelimit

package
v0.0.0-...-09bed4a Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2017 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package rate limit provides a manager to control the execution rate of the process.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(limitter Limiter) guard.Guard

New creates a new guard.Guard with capability of rate limit.

Types

type Limiter

type Limiter interface {
	// Wait sleeps until the process becomes executable according to
	// the state of rate limit.
	Wait(ctx context.Context) error
}

Limiter manage the state of rate limit.

Jump to

Keyboard shortcuts

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