writers

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2022 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRateLimitWriter

func NewRateLimitWriter(rawWriter io.WriteCloser, rateBytes int64) io.WriteCloser

Types

type BytesCounterWriter

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

func NewBytesCounterWriter

func NewBytesCounterWriter(rawWriter io.Writer) *BytesCounterWriter

func (*BytesCounterWriter) Close

func (this *BytesCounterWriter) Close() error

func (*BytesCounterWriter) RawWriter

func (this *BytesCounterWriter) RawWriter() io.Writer

func (*BytesCounterWriter) TotalBytes

func (this *BytesCounterWriter) TotalBytes() int64

func (*BytesCounterWriter) Write

func (this *BytesCounterWriter) Write(p []byte) (n int, err error)

type RateLimitWriter

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

RateLimitWriter 限速写入

func (*RateLimitWriter) Close

func (this *RateLimitWriter) Close() error

func (*RateLimitWriter) Write

func (this *RateLimitWriter) Write(p []byte) (n int, err error)

type TeeWriterCloser

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

func NewTeeWriterCloser

func NewTeeWriterCloser(primaryW io.WriteCloser, secondaryW io.WriteCloser) *TeeWriterCloser

func (*TeeWriterCloser) Close

func (this *TeeWriterCloser) Close() error

func (*TeeWriterCloser) OnFail

func (this *TeeWriterCloser) OnFail(onFail func(err error))

func (*TeeWriterCloser) Write

func (this *TeeWriterCloser) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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