themekit: github.com/Shopify/themekit/src/ratelimiter Index | Files

package ratelimiter

import "github.com/Shopify/themekit/src/ratelimiter"

Index

Package Files

rate_limiter.go

type Limiter Uses

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

Limiter keeps track of an api rate limit and wont let you pass the limit

func New Uses

func New(domain string, apiLimit time.Duration) *Limiter

New creates a new call rate limiter for a single domain

func (*Limiter) Wait Uses

func (limiter *Limiter) Wait()

Wait will block until enough time has passed and the limit will not be passed

Package ratelimiter imports 1 packages (graph) and is imported by 1 packages. Updated 2018-10-04. Refresh now. Tools for package owners.