writers

package
v1.3.8 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPrintWriter added in v0.5.5

func NewPrintWriter(rawWriter io.Writer, tag string) io.Writer

func NewRateLimitWriter

func NewRateLimitWriter(ctx context.Context, 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 PrintWriter added in v0.5.5

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

func (*PrintWriter) Write added in v0.5.5

func (this *PrintWriter) 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