fs

package
v0.0.0-...-3c2e606 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File interface {
	io.Reader
	io.Seeker
	io.Closer
}

File wraps the Reader, Seeker, and Closer interfaces.

type Filesystem

type Filesystem interface {
	// FindFiles finds all files under the given directory whose basenames
	// match the provided pattern. The pattern matching semantics are as for
	// filepath.Match. The result list does not include directories. Path
	// names in the result list include the directory prefix: i.e., they are
	// like "dirPath/subdir/file", not just "file" or "subdir/file". Path
	// names are listed in lexical order.
	FindFiles(dirPath string, basenameGlob string) ([]string, error)
	// ListFiles lists the files in a directory. The result list does not
	// include directories, nor does it recur down the directory tree. The
	// resulting paths include the directory prefix. Path names are listed
	// in lexical order.
	ListFiles(dirPath string) ([]string, error)
	// Open opens an absolute filepath for reading.
	Open(path string) (File, error)
}

Filesystem provides a select set of basic filesystem operations as a compatibility mechanism.

type OS

type OS struct{}

OS implements the Filesystem interface for the native filesystem, as with the standard library's "os" module and friends.

func (OS) FindFiles

func (OS) FindFiles(dirPath string, basenameGlob string) ([]string, error)

FindFiles implements Filesystem.FindFiles.

func (OS) ListFiles

func (OS) ListFiles(dirPath string) ([]string, error)

ListFiles implements Filesystem.ListFiles.

func (OS) Open

func (OS) Open(path string) (File, error)

Open implements Filesystem.Open.

Jump to

Keyboard shortcuts

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