Documentation
¶
Overview ¶
Package files provides utilities for managing collections of files.
Index ¶
- type Files
- func (fs *Files) Add(dir, path string)
- func (fs *Files) AddFile(f file.File)
- func (fs Files) AsSlice() []string
- func (fs Files) Contains(file file.File) bool
- func (fs *Files) Existing()
- func (fs Files) Exists() (file.File, bool)
- func (fs *Files) Expanded()
- func (fs Files) LinksFor(file file.File) error
- func (fs *Files) RelativeTo(base string) Files
- func (fs *Files) Remove(file file.File) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Files ¶
Files represents a collection of filesystem paths. Provides batch operations for working with multiple files.
func New ¶
New creates a Files collection from path strings. Joins each path with the provided directory to create full paths. Empty paths are skipped, and an empty directory uses paths as-is.
func (*Files) Add ¶ added in v0.1.0
Add adds a new file to the collection. Joins the provided path with the directory to create a full path.
func (*Files) AddFile ¶ added in v0.1.0
AddFile adds a file to the collection. If the file already exists in the collection, it is not added again.
func (Files) AsSlice ¶ added in v0.0.18
AsSlice converts the Files collection to a slice of strings.
func (Files) Contains ¶ added in v0.1.0
Contains checks if the collection contains a specified file.
func (*Files) Existing ¶ added in v0.1.11
func (fs *Files) Existing()
Existing prunes the collection to only include existing files.
func (*Files) Expanded ¶ added in v0.1.6
func (fs *Files) Expanded()
Expanded expands all files in the collection.
func (Files) LinksFor ¶ added in v0.0.13
LinksFor creates links for each file in the collection. Creates a link at each path in the collection, pointing to the specified target file. See file.File.Links for more details.
func (*Files) RelativeTo ¶ added in v0.1.5
RelativeTo makes all files in the collection relative to the specified base directory.