Documentation ¶
Overview ¶
Package watcher is the implementation of the application regardless of CLI or UI
Index ¶
- Constants
- type AppConfiguration
- type BackupSettings
- type NoReaderFoundError
- type Watcher
- func (app *Watcher) AddAccountByURI(uri string, user string, password string)
- func (app *Watcher) AddCookieByURI(uri string, name string, value string, expiration string)
- func (app *Watcher) AddItemByURI(uri string, currentItem string)
- func (app *Watcher) AddOAuthClientByURI(uri string, clientID string, clientSecret string, accessToken string, ...)
- func (app *Watcher) Backup(archiveName string, cfg *AppConfiguration)
- func (app *Watcher) ListAccounts(uri string)
- func (app *Watcher) ListCookies(uri string)
- func (app *Watcher) ListOAuthClients(uri string)
- func (app *Watcher) ListRegisteredModules(uri string)
- func (app *Watcher) ListTrackedItems(uri string, includeCompleted bool)
- func (app *Watcher) Restore(archiveName string, cfg *AppConfiguration)
- func (app *Watcher) Run()
Constants ¶
const DefaultConfigurationPath = "./.watcher.yaml"
DefaultConfigurationPath is the default path for the settings file
const DefaultDatabasePath = "./watcher.db"
DefaultDatabasePath is the default path for the database file
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppConfiguration ¶
type AppConfiguration struct { ConfigurationFile string LogLevel string // database file location Database string // backup options Backup struct { BackupSettings Archive struct { Zip bool Tar bool Gzip bool } } Restore struct { BackupSettings } // cli specific options Cli struct { DisableColors bool ForceColors bool DisableTimestamp bool UseUppercaseLevel bool UseTimePassedAsTimestamp bool } // sentry toggles EnableSentry bool DisableSentry bool // run specific options Run struct { RunParallel bool Items []string DownloadDirectory string ModuleURL []string DisableURL []string } }
AppConfiguration contains the persistent configurations/settings across all commands
type BackupSettings ¶
type BackupSettings struct { Database struct { Accounts struct { Enabled bool } Items struct { Enabled bool } OAuth2Clients struct { Enabled bool } Cookies struct { Enabled bool } SQL bool } Settings bool }
BackupSettings are the possible configuration settings for backups and recoveries
type NoReaderFoundError ¶
type NoReaderFoundError struct {
// contains filtered or unexported fields
}
NoReaderFoundError is the error in case the file has no recognized extension
func (NoReaderFoundError) Error ¶
func (e NoReaderFoundError) Error() string
Error prints the error details for our custom error
type Watcher ¶
type Watcher struct { DbCon *database.DbIO ModuleFactory *modules.ModuleFactory Cfg *AppConfiguration }
Watcher contains the database connection and module factory of the main application
func NewWatcher ¶
func NewWatcher(cfg *AppConfiguration) *Watcher
NewWatcher initializes a new Watcher with the default settings
func (*Watcher) AddAccountByURI ¶
AddAccountByURI extracts the module based on the uri and adds an account if not registered already
func (*Watcher) AddCookieByURI ¶
AddCookieByURI adds a cookie based on the uri
func (*Watcher) AddItemByURI ¶
AddItemByURI adds an item based on the uri and sets it to the passed current item if not nil
func (*Watcher) AddOAuthClientByURI ¶
func (app *Watcher) AddOAuthClientByURI( uri string, clientID string, clientSecret string, accessToken string, refreshToken string, )
AddOAuthClientByURI adds an OAuth2 client based on the uri
func (*Watcher) Backup ¶
func (app *Watcher) Backup(archiveName string, cfg *AppConfiguration)
Backup backs up the full database and the configuration
func (*Watcher) ListAccounts ¶
ListAccounts lists all accounts with the option to limit it to a module
func (*Watcher) ListCookies ¶
ListCookies lists all cookies with the option to limit it to a module
func (*Watcher) ListOAuthClients ¶
ListOAuthClients lists all OAuth2 clients with the option to limit it to a module
func (*Watcher) ListRegisteredModules ¶
ListRegisteredModules lists all registered modules
func (*Watcher) ListTrackedItems ¶
ListTrackedItems lists all tracked items with the option to limit it to a module
func (*Watcher) Restore ¶
func (app *Watcher) Restore(archiveName string, cfg *AppConfiguration)
Restore restores the database/settings from the passed archive