rate

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDir

func NewDir(fs http.FileSystem, bytesPerSecond int64, logger *logger.Logger) http.FileSystem

NewDir create a limit http.FileSystem that wrap the real http.FileSystem.

func NewFile

func NewFile(f http.File, bytesPerSecond int64, logger *logger.Logger) http.File

NewFile create a limit http.File that wrap the real http.File.

func NewHTTPDir

func NewHTTPDir(path string, bytesPerSecond int64, logger *logger.Logger) http.FileSystem

NewHTTPDir create a limit http.FileSystem that wrap the real http.Dir.

func NewReader

func NewReader(r io.Reader, bytesPerSecond int64, logger *logger.Logger) io.Reader

NewReader create a limit io.Reader that wrap the real io.Reader. The bytesPerSecond must be greater than defaultBufSize of io.Reader.

func NewReaderAt

func NewReaderAt(ra io.ReaderAt, bytesPerSecond int64, logger *logger.Logger) io.ReaderAt

NewReaderAt create a limit io.ReaderAt that wrap the real io.ReaderAt. The bytesPerSecond must be greater than defaultBufSize of io.ReaderAt.

Types

This section is empty.

Jump to

Keyboard shortcuts

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