Documentation
¶
Index ¶
- type Application
- func (app *Application) AddCollectPath(path, parentDir string) error
- func (app *Application) AddIgnorePattern(pattern string) error
- func (app *Application) CopyFiles() error
- func (app *Application) GetCollectPaths() ([]SourcePath, error)
- func (app *Application) GetIgnorePatterns() ([]string, error)
- func (app *Application) RemoveCollectPath(pathname string) error
- func (app *Application) RemoveCollectPaths(pathnames []string) error
- func (app *Application) RemoveIgnorePattern(patternString string) error
- func (app *Application) RemoveIgnorePatterns(patterns []string) error
- func (app *Application) SetupDB() error
- func (app *Application) SetupDataDir() error
- type SourcePath
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application struct {
DB *database.Queries // Interface for executing database queries.
DataDir string // Directory where the application data is stored.
Destination string // Directory where the collected files are copied.
Name string // Name of the application.
}
Application is the heart of the Dotfiles Collector application.
func New ¶
func New(name string) *Application
New returns a new instance of the application with the provided name.
func (*Application) AddCollectPath ¶
func (app *Application) AddCollectPath(path, parentDir string) error
AddCollectPath adds a new path to the collector.
func (*Application) AddIgnorePattern ¶
func (app *Application) AddIgnorePattern(pattern string) error
AddIgnorePattern adds an ignore pattern to the collector.
func (*Application) CopyFiles ¶
func (app *Application) CopyFiles() error
CopyFiles prepares source paths and copies them to the destination.
func (*Application) GetCollectPaths ¶
func (app *Application) GetCollectPaths() ([]SourcePath, error)
GetCollectPaths returns a list of source paths added to the collector.
func (*Application) GetIgnorePatterns ¶
func (app *Application) GetIgnorePatterns() ([]string, error)
GetIgnorePatterns returns a list of ignore patterns added to the collector.
func (*Application) RemoveCollectPath ¶
func (app *Application) RemoveCollectPath(pathname string) error
RemoveCollectPath removes a source path from the collector.
func (*Application) RemoveCollectPaths ¶
func (app *Application) RemoveCollectPaths(pathnames []string) error
RemoveCollectPaths removes the given paths from the database.
func (*Application) RemoveIgnorePattern ¶
func (app *Application) RemoveIgnorePattern(patternString string) error
RemoveIgnorePattern removes an ignore pattern from the collector.
func (*Application) RemoveIgnorePatterns ¶
func (app *Application) RemoveIgnorePatterns(patterns []string) error
RemoveIgnorePatterns removes the given patterns from the database.
func (*Application) SetupDB ¶
func (app *Application) SetupDB() error
SetupDB opens the database connection, initializes the schema and assigns the connection to the application.
func (*Application) SetupDataDir ¶
func (app *Application) SetupDataDir() error
SetupDataDir sets up directory paths for the application based on the operating system.
type SourcePath ¶
SourcePath represents a path to collect files from.