Documentation
¶
Overview ¶
Package issuewatcher wraps the issuefinder.Finder with some app-specific know-how in order to layer on top of the generic issuefinder to include behaviors necessary for finding issues from all known locations by reading our settings file and running the appropriate searches.
Index ¶
- type Scanner
- func (s *Scanner) CacheFile() string
- func (s *Scanner) Deserialize() error
- func (s *Scanner) DisableDB() *Scanner
- func (s *Scanner) DisableSFTPUpload() *Scanner
- func (s *Scanner) DisableScannedUpload() *Scanner
- func (s *Scanner) DisableWeb() *Scanner
- func (s *Scanner) Duplicate() *Scanner
- func (s *Scanner) LookupIssues(key *schema.Key) []*schema.Issue
- func (s *Scanner) Scan() error
- func (s *Scanner) Serialize() error
- type Watcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Scanner ¶
type Scanner struct { Finder *issuefinder.Finder Webroot string Tempdir string ScanUpload string PDFUpload string PDFBatchMARCOrgCode string Lookup *schema.Lookup CanonIssues map[string]*schema.Issue // contains filtered or unexported fields }
Scanner sets up all the necessary data to run issuefinders across all our standard locations. By default, a Scan() call won't do anything - one or more of the EnableXXX methods must first be called to set up paths.
func NewScanner ¶
NewScanner sets up the Scanner with no data
func (*Scanner) CacheFile ¶
CacheFile returns the standard path to the cache file based on the configuration of the watcher
func (*Scanner) Deserialize ¶
Deserialize attempts to read the CacheFile if it exists, populating the searchers and issue lookup
func (*Scanner) DisableSFTPUpload ¶
DisableSFTPUpload sets the flag to skip sftp upload searches
func (*Scanner) DisableScannedUpload ¶
DisableScannedUpload sets the flag to skip scanned upload searches
func (*Scanner) DisableWeb ¶
DisableWeb sets the flag to skip web searches
func (*Scanner) Duplicate ¶
Duplicate creates a new Scanner with the same configuration as this one, but with no data
func (*Scanner) LookupIssues ¶
LookupIssues returns a list of schema Issues for the give search key
func (*Scanner) Scan ¶
Scan calls all the individual find* functions for the myriad of ways we store issue information in the various locations (dependent on what's been enabled). The Scanner's issuefinder is replaced only after successful searching to ensure minimal disruption, especially in the event of an error.
type Watcher ¶
A Watcher wraps the Scanner to provide a long-running issue watcher which scans issue directories and the live site at regular intervals
func (*Watcher) Stop ¶
func (w *Watcher) Stop()
Stop signals the watch loop to stop running, allowing for cleanup to happen safely