Documentation
¶
Overview ¶
Package fs provides filesystem abstractions for reading files from local disk or git repos.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileSystem ¶
type FileSystem interface {
ReadFile(path string) ([]byte, error)
Stat(path string) (FileInfo, error)
ReadDir(path string) ([]DirEntry, error)
}
FileSystem abstracts file operations so callers can work with either the local filesystem or a git object database.
type GitFS ¶
type GitFS struct {
// contains filtered or unexported fields
}
GitFS implements FileSystem by reading from a git ref (branch, tag, or commit).
func NewGitFS ¶
NewGitFS creates a GitFS that reads files from the given ref in the repository at repoPath.
func (*GitFS) ReadDir ¶
ReadDir lists the immediate children of the directory at the given path in the git ref.
type LocalFS ¶
type LocalFS struct {
// contains filtered or unexported fields
}
LocalFS implements FileSystem using the local filesystem.
func NewLocalFS ¶
NewLocalFS creates a LocalFS rooted at the given directory.
func (*LocalFS) ReadDir ¶
ReadDir lists the immediate children of the directory at the given path relative to the root.