ioutil

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 14 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultDESDecryptorBufSize = 32 * 1024

Functions

func CopyBuffer

func CopyBuffer(ctx context.Context, dst io.Writer, src io.Reader, buf []byte) (written int64, err error)

CopyBuffer stops when ctx ends; a nil buf is allocated.

func CopyDir

func CopyDir(ctx context.Context, source string, dest string) (err error)

func CopyFile

func CopyFile(ctx context.Context, src, dst string) error

func DESDecryptor

func DESDecryptor(ctx context.Context, key, iv []byte, cipherReader io.Reader, size int64) (io.Reader, error)

func DecryptAES

func DecryptAES(data []byte, password string) ([]byte, error)

func DecryptAESFile

func DecryptAESFile(src, dst string, password string) error

func EncryptAES

func EncryptAES(data []byte, password string) ([]byte, error)

func EncryptAESFile

func EncryptAESFile(src, dst string, password string) error

func LimitReadAll

func LimitReadAll(ctx context.Context, r io.Reader, p []byte) (int, error)

func LimitWriteAll

func LimitWriteAll(ctx context.Context, w io.Writer, p []byte) (int, error)

func Targz

func Targz(ctx context.Context, src, dst string) error

Targz writes the regular files under src into dst.

Types

type LimitReader added in v0.5.0

type LimitReader interface {
	io.ReadCloser
	Consumed() int
	Remaining() int
}

LimitReader errors past max rather than returning EOF, so truncated untrusted input never looks complete.

func NewLimitReader added in v0.5.0

func NewLimitReader(r io.Reader, max int) LimitReader

NewLimitReader: exactly max bytes ends in io.EOF; the error is uncategorized so the caller picks the status. Close closes r if it is a Closer.

type LimitWriter added in v0.3.13

type LimitWriter interface {
	io.Writer
	Written() int
	Remaining() int
}

func NewLimitWriter added in v0.3.13

func NewLimitWriter(w io.Writer, max int) LimitWriter

type ProgressWriter

type ProgressWriter interface {
	io.Writer
	Written() int64
	Percentage() float64
}

func NewProgressWriter

func NewProgressWriter(ctx context.Context, w io.Writer, size int64) ProgressWriter

type TailWriter added in v0.7.0

type TailWriter interface {
	io.Writer
	Bytes() []byte
	String() string
}

func NewTailWriter added in v0.7.0

func NewTailWriter(limit int) TailWriter

Jump to

Keyboard shortcuts

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