internal

package
v0.0.0-...-001891a Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2025 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultBytesPerSecond = 5 * 1024 * 1024

Functions

func NewThrottledReadCloser

func NewThrottledReadCloser(reader io.ReadCloser, bytesPerSecond int) io.ReadCloser

NewThrottledReadCloser creates a new rate-limited ReadCloser bytesPerSecond specifies the maximum bytes to read per second

func ThrottledCopyN

func ThrottledCopyN(dst io.Writer, src io.Reader, n int64, bytesPerSecond int) (written int64, err error)

ThrottledCopyN performs a rate-limited copy of n bytes

Types

type ThrottledReadCloser

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

ThrottledReadCloser wraps an io.ReadCloser with rate limiting

func (*ThrottledReadCloser) Close

func (t *ThrottledReadCloser) Close() error

Close implements io.Closer

func (*ThrottledReadCloser) Read

func (t *ThrottledReadCloser) Read(p []byte) (n int, err error)

Read implements io.Reader with rate limiting

Directories

Path Synopsis
Package aes7z implements the 7-zip AES decryption.
Package aes7z implements the 7-zip AES decryption.
Package bcj2 implements the BCJ2 filter for x86 binaries.
Package bcj2 implements the BCJ2 filter for x86 binaries.
Package bra implements the branch rewriting filter for binaries.
Package bra implements the branch rewriting filter for binaries.
Package brotli implements the Brotli decompressor.
Package brotli implements the Brotli decompressor.
Package bzip2 implements the Bzip2 decompressor.
Package bzip2 implements the Bzip2 decompressor.
Package deflate implements the Deflate decompressor.
Package deflate implements the Deflate decompressor.
Package delta implements the Delta filter.
Package delta implements the Delta filter.
Package lz4 implements the LZ4 decompressor.
Package lz4 implements the LZ4 decompressor.
Package lzma implements the LZMA decompressor.
Package lzma implements the LZMA decompressor.
Package lzma2 implements the LZMA2 decompressor.
Package lzma2 implements the LZMA2 decompressor.
Package pool implements the reader pooling.
Package pool implements the reader pooling.
Package util implements various utility types and interfaces.
Package util implements various utility types and interfaces.
Package zstd implements the Zstandard decompressor.
Package zstd implements the Zstandard decompressor.

Jump to

Keyboard shortcuts

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