limiter

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 5, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IoCopy

func IoCopy(dst io.Writer, src io.Reader, fn ...func(count int)) (written int64, isSrcErr bool, err error)

Types

type Reader

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

func NewReader

func NewReader(r io.Reader) *Reader

func NewReaderWithContext

func NewReaderWithContext(r io.Reader, ctx context.Context) *Reader

func (*Reader) Read

func (s *Reader) Read(p []byte) (int, error)

func (*Reader) SetRateLimit

func (s *Reader) SetRateLimit(bytesPerSec float64)

type Writer

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

func NewWriter

func NewWriter(w io.Writer) *Writer

func NewWriterWithContext

func NewWriterWithContext(w io.Writer, ctx context.Context) *Writer

func (*Writer) SetRateLimit

func (s *Writer) SetRateLimit(bytesPerSec float64)

func (*Writer) Write

func (s *Writer) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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