bucket

package
v0.0.0-...-84d4900 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package bucket contains a leeking bucket to be used with a web server for slow down the requests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBucket

func NewBucket(size int, timeout time.Duration, s http.Handler) http.Handler

NewBucket creats a new bucket

Types

type LeekingBucket

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

LeekingBucket implements the bucket

func (*LeekingBucket) ServeHTTP

func (l *LeekingBucket) ServeHTTP(rw http.ResponseWriter, req *http.Request)

ServeHTTP servers a request.

Jump to

Keyboard shortcuts

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