Documentation ¶
Index ¶
- func CopyDir(fs afero.Fs, from, to string, shouldCopy func(filename string) bool) error
- func CopyFile(fs afero.Fs, from, to string) error
- func NewMultiWriteCloser(writeClosers ...io.WriteCloser) io.WriteCloser
- func ToReadCloser(r io.Reader) io.ReadCloser
- func ToWriteCloser(w io.Writer) io.WriteCloser
- type FlexiWriter
- type ReadSeekCloser
- type ReadSeekCloserProvider
- type ReadSeeker
- type ReadSeekerNoOpCloser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMultiWriteCloser ¶
func NewMultiWriteCloser(writeClosers ...io.WriteCloser) io.WriteCloser
NewMultiWriteCloser creates a new io.WriteCloser that duplicates its writes to all the provided writers.
func ToReadCloser ¶
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 ¶
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.
Types ¶
type FlexiWriter ¶ added in v0.16.0
type FlexiWriter interface { io.Writer io.ByteWriter WriteString(s string) (int, error) WriteRune(r rune) (int, error) }
As implemented by strings.Builder.
type ReadSeekCloser ¶
type ReadSeekCloser interface { ReadSeeker io.Closer }
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.13.0
type ReadSeekCloserProvider interface {
ReadSeekCloser() (ReadSeekCloser, error)
}
ReadSeekCloserProvider provides a ReadSeekCloser.
type ReadSeeker ¶
ReadSeeker wraps io.Reader and io.Seeker.
type ReadSeekerNoOpCloser ¶
type ReadSeekerNoOpCloser struct {
ReadSeeker
}
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.