package ratelimiter

import "github.com/google/certificate-transparency-go/fixchain/ratelimiter"

Package ratelimiter provides an exceedingly simple rate limiter.

Index

Types

type Limiter

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

Limiter is a simple rate limiter.

func NewLimiter

func NewLimiter(limit int) *Limiter

NewLimiter creates a new Limiter with a rate of limit per second.

func (*Limiter) Wait

func (l *Limiter) Wait()

Wait blocks for the amount of time required by the Limiter so as to not exceed its rate.

Source Files

limiter.go

Version
v1.0.16
Published
Apr 20, 2018
Platform
linux/amd64
Imports
1 packages
Last checked
3 hours ago

Tools for package owners.