v0.112.0 Latest Latest

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

Go to latest
Published: May 23, 2023 License: Apache-2.0 Imports: 6 Imported by: 39




This section is empty.


This section is empty.


func CopyDir added in v0.56.0

func CopyDir(fs afero.Fs, from, to string, shouldCopy func(filename string) bool) error

CopyDir copies a directory.

func CopyFile added in v0.56.0

func CopyFile(fs afero.Fs, from, to string) error

CopyFile copies a file.

func NewMultiWriteCloser

func NewMultiWriteCloser(writeClosers io.WriteCloser

NewMultiWriteCloser creates a new io.WriteCloser that duplicates its writes to all the provided writers.

func ToReadCloser added in v0.54.0

func ToReadCloser(r io.Reader) io.ReadCloser

ToReadCloser creates an io.ReadCloser from the given io.Reader. If it's not already, one will be created with a Close method that does nothing.

func ToWriteCloser added in v0.54.0

func ToWriteCloser(w io.Writer) io.WriteCloser

ToWriteCloser creates an io.WriteCloser from the given io.Writer. If it's not already, one will be created with a Close method that does nothing.


type FlexiWriter added in v0.93.0

type FlexiWriter interface {
	WriteString(s string) (int, error)
	WriteRune(r rune) (int, error)

As implemented by strings.Builder.

type HasBytesWriter added in v0.103.0

type HasBytesWriter struct {
	Match   bool
	Pattern []byte
	// contains filtered or unexported fields

HasBytesWriter is a writer that will set Match to true if the given pattern is found in the stream.

func (*HasBytesWriter) Write added in v0.103.0

func (h *HasBytesWriter) Write(p []byte) (n int, err error)

type ReadSeekCloser

type ReadSeekCloser interface {

ReadSeekCloser is implemented by afero.File. We use this as the common type for content in Resource objects, even for strings.

type ReadSeekCloserProvider added in v0.90.0

type ReadSeekCloserProvider interface {
	ReadSeekCloser() (ReadSeekCloser, error)

ReadSeekCloserProvider provides a ReadSeekCloser.

type ReadSeeker

type ReadSeeker interface {

ReadSeeker wraps io.Reader and io.Seeker.

type ReadSeekerNoOpCloser

type ReadSeekerNoOpCloser struct {

ReadSeekerNoOpCloser implements ReadSeekCloser by doing nothing in Close. TODO(bep) rename this and similar to ReadSeekerNopCloser, naming used in stdlib, which kind of makes sense.

func NewReadSeekerNoOpCloser

func NewReadSeekerNoOpCloser(r ReadSeeker) ReadSeekerNoOpCloser

NewReadSeekerNoOpCloser creates a new ReadSeekerNoOpCloser with the given ReadSeeker.

func NewReadSeekerNoOpCloserFromString

func NewReadSeekerNoOpCloserFromString(content string) ReadSeekerNoOpCloser

NewReadSeekerNoOpCloserFromString uses strings.NewReader to create a new ReadSeekerNoOpCloser from the given string.

func (ReadSeekerNoOpCloser) Close

func (r ReadSeekerNoOpCloser) Close() error

Close does nothing.

Jump to

Keyboard shortcuts

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