Documentation
¶
Index ¶
- Constants
- Variables
- func FileHandler(w http.ResponseWriter, req *http.Request)
- func FilePath(title, issue, filename string) string
- func HomeHandler(w http.ResponseWriter, req *http.Request)
- func IssueHandler(w http.ResponseWriter, req *http.Request)
- func IssuePath(title, issue string) string
- func IssueWorkflowHandler(w http.ResponseWriter, req *http.Request)
- func IssueWorkflowPath(title, issue, action string) string
- func Setup(r *mux.Router, baseWebPath string, c *config.Config, w *issuewatcher.Watcher)
- func TitleHandler(w http.ResponseWriter, req *http.Request)
- func TitlePath(name string) string
- type File
- type Issue
- type Searcher
- func (s *Searcher) BuildInProcessList() error
- func (s *Searcher) FailedSearch() bool
- func (s *Searcher) IsInProcess(issueKey string) bool
- func (s *Searcher) Ready() bool
- func (s *Searcher) RemoveIssue(i *Issue)
- func (s *Searcher) TitleLookup(slug string) *Title
- func (s *Searcher) Titles() []*Title
- func (s *Searcher) TopErrors() apperr.List
- type Title
- type TitleType
Constants ¶
const DaysIssueConsideredNew = 14
DaysIssueConsideredNew is how long we warn users that the issue is new - but it can be queued before that warning goes away so long as DaysIssueConsideredDangerous has elapsed
Variables ¶
var ( // Layout is the base template, cloned from the responder's layout, from // which all subpages are built Layout *tmpl.TRoot // TitleList renders the uploaded issues landing page TitleList *tmpl.Template // TitleTmpl renders the list of issues and a summary of errors for a given title TitleTmpl *tmpl.Template // IssueTmpl renders the list of PDFs and errors in a given issue IssueTmpl *tmpl.Template )
Functions ¶
func FileHandler ¶
func FileHandler(w http.ResponseWriter, req *http.Request)
FileHandler attempts to find and display a file to the browser
func HomeHandler ¶
func HomeHandler(w http.ResponseWriter, req *http.Request)
HomeHandler spits out the title list
func IssueHandler ¶
func IssueHandler(w http.ResponseWriter, req *http.Request)
IssueHandler prints a list of pages for a given issue
func IssueWorkflowHandler ¶
func IssueWorkflowHandler(w http.ResponseWriter, req *http.Request)
IssueWorkflowHandler handles setting up the issue move job
func IssueWorkflowPath ¶
IssueWorkflowPath returns the path to make workflow changes to the given issue
func TitleHandler ¶
func TitleHandler(w http.ResponseWriter, req *http.Request)
TitleHandler prints a list of issues for a given title
Types ¶
type File ¶
File wraps a schema.File for web presentation
type Issue ¶
type Issue struct { *uploads.Issue Slug string // Short, URL-friendly identifier for an issue Title *Title // Title to which this issue belongs QueueInfo template.HTML // Informational message from the queue process, if any Files []*File // List of files FileLookup map[string]*File // Lookup for finding a File by its filename / slug }
Issue wraps uploads.Issue for web presentation
func (*Issue) ChildErrors ¶
ChildErrors reports the number of files with errors
func (*Issue) HasErrors ¶
HasErrors reports true if this issue has any errors - due to the way AddError works in the schema, this will report true if the issue has an error *or* if one or more files have errors
func (*Issue) IsNew ¶
IsNew tells the presentation if the issue is fairly new, which can be important for some publishers who upload over several days
func (*Issue) WorkflowPath ¶
WorkflowPath returns the path to perform a workflow action against this issue
type Searcher ¶
Searcher holds onto a Scanner for running local queries against scan and sftp uploads. This structure is completely thread-safe; a single instance can and should used for the life of the web server. All data access is via functions to allow automatic rescanning of the file system.
func (*Searcher) BuildInProcessList ¶
BuildInProcessList pulls all pending SFTP move jobs from the database and indexes them by location in order to avoid showing issues which are already awaiting processing.
func (*Searcher) FailedSearch ¶
FailedSearch returns true if too many scans have failed in a row
func (*Searcher) IsInProcess ¶
IsInProcess returns whether the given issue key has been seen in the in-process issue list
func (*Searcher) Ready ¶
Ready returns whether or not the searcher has completed at least one search
func (*Searcher) RemoveIssue ¶
RemoveIssue takes the given issue out of all lookups to hide it from front-end queueing operations
func (*Searcher) TitleLookup ¶
TitleLookup returns the Title for a given slug
type Title ¶
type Title struct { *schema.Title Slug string Issues []*Issue IssueLookup map[string]*Issue Type TitleType }
Title wraps a schema.Title with some extra information for web presentation.