io

package
v6.20.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOwnerMode

func GetOwnerMode(fInfo os.FileInfo) (os.FileMode, int, int)

GetOwnerMode returns the file mode, owner UID, and owner GID for the given file.

func GetPathMode

func GetPathMode(path string) (os.FileMode, error)

GetPathMode returns a os.FileMode for the provided path.

func NewReadSeeker

func NewReadSeeker(reader io.Reader, seeker io.Seeker) io.ReadSeeker

NewReadSeeker combines provided io.Reader and io.Seeker into a new io.ReadSeeker.

func WriteAll

func WriteAll(w io.Writer, data []byte) error

WriteAll copies content of data to specified writer.

Types

type BytesReadCloser

type BytesReadCloser struct {
	Buf *bytes.Buffer
}

BytesReadCloser is a basic in-memory reader with a closer interface.

func (BytesReadCloser) Close

func (r BytesReadCloser) Close() error

Close is a no-op.

func (BytesReadCloser) Read

func (r BytesReadCloser) Read(b []byte) (n int, err error)

Read just returns the buffer.

type QuotaWriter

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

QuotaWriter returns an error once a given write quota gets exceeded.

func NewQuotaWriter

func NewQuotaWriter(writer io.Writer, quota int64) *QuotaWriter

NewQuotaWriter returns a new QuotaWriter wrapping the given writer.

If the given quota is negative, then no quota is applied.

func (*QuotaWriter) Write

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

Write implements the Writer interface.

Jump to

Keyboard shortcuts

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