ioutil

package
Version: v0.0.0-...-21c7782 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteAll

func WriteAll(data []byte, writer io.Writer) (n int, err error)

WriteFull calls writer.Write until all of data is written, or an is error returned.

Types

type CancelableReader

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

CancelableReader позволяет читать данные с контекстом

func NewCancelableReader

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

func (*CancelableReader) Read

func (c *CancelableReader) Read(p []byte) (int, error)

func (*CancelableReader) ReadByte

func (c *CancelableReader) ReadByte() (byte, error)

type Counter

type Counter interface {
	Count() int
}

type ReadCounter

type ReadCounter interface {
	io.Reader
	Counter
}

func CountingReader

func CountingReader(r io.Reader) ReadCounter

type ReaderFunc

type ReaderFunc func(p []byte) (int, error)

ReaderFunc implements io.Reader as function type with a Read method.

func (ReaderFunc) Read

func (f ReaderFunc) Read(p []byte) (int, error)

type WriteCounter

type WriteCounter interface {
	io.Writer
	Counter
}

func CountingWriter

func CountingWriter(w io.Writer) WriteCounter

type WriterFunc

type WriterFunc func(p []byte) (int, error)

WriterFunc implements io.Writer as function type with a Write method.

func (WriterFunc) Write

func (f WriterFunc) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL