bandwidthlimit

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateConfig

func ValidateConfig(conf Config) error

func WrapReadCloser

func WrapReadCloser(rc io.ReadCloser, bucket *ratelimit.Bucket) io.ReadCloser

Types

type Config

type Config struct {
	Max            int64 // < 0 means no limit, BucketCapacity is irrelevant then
	BucketCapacity int64
}

func NoLimitConfig

func NoLimitConfig() Config

type Wrapper

type Wrapper interface {
	WrapReadCloser(io.ReadCloser) io.ReadCloser
}

func WrapperFromConfig

func WrapperFromConfig(conf Config) Wrapper

Jump to

Keyboard shortcuts

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