app

package
v0.0.0-...-1c70c9d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

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

type SourcePath struct {
	ID     int64
	Path   string
	Subdir string
}

SourcePath represents a path to collect files from.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL