Documentation ¶
Index ¶
- type File
- type Filer
- func FromDirectory(path string) (Filer, error)
- func FromGit(repo *git.Repository, headRef plumbing.ReferenceName) (Filer, error)
- func FromGitURL(url string) (Filer, error)
- func FromSiva(path string) (Filer, error)
- func FromZIP(path string) (Filer, error)
- func NestFiler(filer Filer, prefix string) Filer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type File ¶
File represents a file in the virtual file system: every node is either a regular file or a directory. Symlinks are dereferenced in the implementations.
type Filer ¶
type Filer interface { // ReadFile returns the contents of a file given it's path. ReadFile(path string) (content []byte, err error) // ReadDir lists a directory. ReadDir(path string) ([]File, error) // Close frees all the resources allocated by this Filer. Close() // PathsAreAlwaysSlash indicates whether the path separator is platform-independent ("/") or // OS-specific. PathsAreAlwaysSlash() bool }
A Filer provides a list of files.
func FromDirectory ¶
FromDirectory returns a Filer that allows accessing over all the files contained in a directory.
func FromGit ¶ added in v3.1.0
func FromGit(repo *git.Repository, headRef plumbing.ReferenceName) (Filer, error)
FromGit returns a Filer that allows accessing all the files in a Git repository
func FromGitURL ¶
FromGitURL returns a Filer that allows accessing all the files in a Git repository given its URL.
func FromSiva ¶
FromSiva returns a Filer that allows accessing all the files in a Git repository contained in a Siva file. See https://github.com/src-d/go-siva and https://github.com/src-d/go-billy-siva