MCPcopy
hub / github.com/redspread/spread / NewFileInput

Function NewFileInput

pkg/input/dir/input.go:17–25  ·  view source on GitHub ↗

NewFileInput returns an Input based on a file system

(path string)

Source from the content-addressed store, hash-verified

15
16// NewFileInput returns an Input based on a file system
17func NewFileInput(path string) (*FileInput, error) {
18 if _, err := os.Stat(path); err != nil {
19 return nil, err
20 }
21
22 return &FileInput{
23 FileSource: FileSource(path),
24 }, nil
25}
26
27// Build creates an Entity by selecting the entity with the lowest type number and attaching higher objects recursively
28func (d *FileInput) Build() (entity.Entity, error) {

Callers 1

testTempFileInputFunction · 0.85

Calls 1

FileSourceTypeAlias · 0.85

Tested by 1

testTempFileInputFunction · 0.68