Documentation
¶
Index ¶
- func Diff(source, target <-chan Metadata, forceModified bool, ...) (int, error)
- func DirExists(path string) (bool, error)
- func DropExt(path string) string
- func Exists(path string) (bool, error)
- func FilenameStem(path string) string
- func Walk(basePath string, logger util.Logger, ...) <-chan Metadata
- func WriteString(path string, content string) error
- type DiffChange
- type DiffKind
- type Metadata
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Diff ¶
func Diff(source, target <-chan Metadata, forceModified bool, callback func(DiffChange) error) (int, error)
Diff compares two sources of Metadata and report the file changes, using the file modification date.
Returns the number of files in the source.
Warning: The Metadata have to be sorted by their Path for the diffing to work properly.
func FilenameStem ¶
FilenameStem returns the filename component of the given path, after removing its file extension.
func Walk ¶
func Walk(basePath string, logger util.Logger, shouldIgnorePath func(string) (bool, error)) <-chan Metadata
Walk emits the metadata of each file stored in the directory if they pass the given shouldIgnorePath closure. Hidden files and directories are ignored.
func WriteString ¶
WriteString writes the given content into a new file at the given path, creating any intermediate directories if needed.
Types ¶
type DiffChange ¶
DiffChange represents a file change made in a directory.