Documentation ¶
Overview ¶
Package directoryservice provides a useful abstraction for working with temporary directories and files they contain without the need to explicitly deal with the underlying OS's impementation. This can be useful for things like temporarily cloning Git repositories.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DirectoryService ¶
type DirectoryService interface { // BasePath returns the base path for the DirectoryService. BasePath() string // FullPath returns a full path given a relative one. FullPath(string) string // Recurse recursively lists a directory and returns a list of paths to // files which pass all of the Filters. Recurse(string, ...Filter) ([]string, error) // FullPath returns a relative path given a full one. RelativePath(string) (string, error) // Cleanup removes the whole base directory. It invalidates the current // DirectoryService. Cleanup() error }
DirectoryService takes responsibility of creating and removing local temporary directories.
func NewDirectoryService ¶
func NewDirectoryService(path string) (DirectoryService, error)
NewDirectoryService returns a new instance of DirectoryService. If an empty path is passed a temporary directory is created.
Click to show internal directories.
Click to hide internal directories.