Codebase list golang-github-mitchellh-go-fs / debian/0.0_git20180402.b7b9ca4-1 directory.go
debian/0.0_git20180402.b7b9ca4-1

Tree @debian/0.0_git20180402.b7b9ca4-1 (Download .tar.gz)

directory.go @debian/0.0_git20180402.b7b9ca4-1raw · history · blame

package fs

// Directory is an entry in a filesystem that stores files.
type Directory interface {
	Entry(name string) DirectoryEntry
	Entries() []DirectoryEntry
	AddDirectory(name string) (DirectoryEntry, error)
	AddFile(name string) (DirectoryEntry, error)
}

// DirectoryEntry represents a single entry within a directory,
// which can be either another Directory or a File.
type DirectoryEntry interface {
	Name() string
	IsDir() bool
	Dir() (Directory, error)
	File() (File, error)
}