iout

package
v1.3.10 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MkdirMode os.FileMode = 0770

Functions

func CopyBytes added in v1.3.7

func CopyBytes(b []byte) []byte

func CopyFile added in v1.1.0

func CopyFile(src, dst string, m os.FileMode) error

func CountLines added in v1.3.7

func CountLines(b []byte) int

func MkdirAll added in v1.3.1

func MkdirAll(filename string) error

func MkdirAllCopyFile added in v1.1.0

func MkdirAllCopyFile(src, dst string, m os.FileMode) error

func MkdirAllCopyFileSync added in v1.1.0

func MkdirAllCopyFileSync(src, dst string, m os.FileMode) error

func MkdirAllWriteFile added in v1.1.0

func MkdirAllWriteFile(filename string, src []byte, m os.FileMode) error

func MultiErrors

func MultiErrors(errs ...error) error

Returns an error (MultiError) or nil if the errors added were all nil.

Types

type AutoBufWriter

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

Flushes after x time if the buffer doesn't get filled. Safe to use concurrently.

func NewAutoBufWriter

func NewAutoBufWriter(w io.Writer, size int) *AutoBufWriter

func (*AutoBufWriter) Close

func (w *AutoBufWriter) Close() error

Implements io.Closer

func (*AutoBufWriter) Write

func (w *AutoBufWriter) Write(p []byte) (int, error)

Implements io.Writer

type FnCloser added in v1.3.0

type FnCloser func() error

func (FnCloser) Close added in v1.3.0

func (c FnCloser) Close() error

type FnReader added in v1.3.0

type FnReader func([]byte) (int, error)

func (FnReader) Read added in v1.3.0

func (r FnReader) Read(p []byte) (int, error)

type FnWriter added in v1.1.0

type FnWriter func([]byte) (int, error)

func (FnWriter) Write added in v1.1.0

func (w FnWriter) Write(p []byte) (int, error)

type LimitedWriter

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

func NewLimitedWriter

func NewLimitedWriter(size int) *LimitedWriter

func (*LimitedWriter) Bytes

func (w *LimitedWriter) Bytes() []byte

func (*LimitedWriter) Write

func (w *LimitedWriter) Write(p []byte) (n int, err error)

type MultiError

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

func (*MultiError) Add

func (me *MultiError) Add(err error)

Can be used concurrently.

func (*MultiError) Error

func (me *MultiError) Error() string

func (*MultiError) Result

func (me *MultiError) Result() error

Returns itself, or nil if it has no errors.

type PausedWriter added in v1.3.3

type PausedWriter struct {
	Wr io.Writer
	// contains filtered or unexported fields
}

func NewPausedWriter added in v1.3.3

func NewPausedWriter(wr io.Writer) *PausedWriter

func (*PausedWriter) Pause added in v1.3.3

func (pw *PausedWriter) Pause(v bool)

func (*PausedWriter) Unpause added in v1.3.3

func (pw *PausedWriter) Unpause()

func (*PausedWriter) Write added in v1.3.3

func (pw *PausedWriter) Write(b []byte) (int, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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