aboutsummaryrefslogtreecommitdiffhomepage
path: root/source/filesystem.go
diff options
context:
space:
mode:
Diffstat (limited to 'source/filesystem.go')
-rw-r--r--source/filesystem.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/filesystem.go b/source/filesystem.go
index 3f4bf0ff1..0c1a6ac7b 100644
--- a/source/filesystem.go
+++ b/source/filesystem.go
@@ -24,6 +24,7 @@ import (
"golang.org/x/text/unicode/norm"
)
+// Filesystem represents a source filesystem.
type Filesystem struct {
files []ReadableFile
filesInit sync.Once
@@ -33,14 +34,17 @@ type Filesystem struct {
SourceSpec
}
+// Input describes a source input.
type Input interface {
Files() []ReadableFile
}
+// NewFilesystem returns a new filesytem for a given source spec.
func (sp SourceSpec) NewFilesystem(base string) *Filesystem {
return &Filesystem{SourceSpec: sp, Base: base}
}
+// Files returns a slice of readable files.
func (f *Filesystem) Files() []ReadableFile {
f.filesInit.Do(func() {
f.captureFiles()