hugo: github.com/gohugoio/hugo/common/hugio Index | Files

package hugio

import "github.com/gohugoio/hugo/common/hugio"

Index

Package Files

copy.go readers.go writers.go

func CopyDir Uses

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

CopyDir copies a directory.

func CopyFile Uses

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

CopyFile copies a file.

func NewMultiWriteCloser Uses

func NewMultiWriteCloser(writeClosers ...io.WriteCloser) io.WriteCloser

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

func ToReadCloser Uses

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 Uses

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 ReadSeekCloser Uses

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 ReadSeeker Uses

type ReadSeeker interface {
    io.Reader
    io.Seeker
}

ReadSeeker wraps io.Reader and io.Seeker.

type ReadSeekerNoOpCloser Uses

type ReadSeekerNoOpCloser struct {
    ReadSeeker
}

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

func NewReadSeekerNoOpCloser Uses

func NewReadSeekerNoOpCloser(r ReadSeeker) ReadSeekerNoOpCloser

NewReadSeekerNoOpCloser creates a new ReadSeekerNoOpCloser with the given ReadSeeker.

func NewReadSeekerNoOpCloserFromString Uses

func NewReadSeekerNoOpCloserFromString(content string) ReadSeekerNoOpCloser

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

func (ReadSeekerNoOpCloser) Close Uses

func (r ReadSeekerNoOpCloser) Close() error

Close does nothing.

Package hugio imports 7 packages (graph) and is imported by 109 packages. Updated 2019-07-27. Refresh now. Tools for package owners.