Documentation ¶
Index ¶
Constants ¶
View Source
const ( SQL_ERR_NO_ROWS = `sql: no rows in result set` DATE_LAYOUT = `2006-01-02` DATE_TIME_LAYOUT = `2006-01-02 15:04:05 MST` START_YEAR = 2003 START_MONTH = time.November // SQL queries {{{ Q_HITS = `` /* 450-byte string literal not displayed */ Q_BINGOS = `` /* 196-byte string literal not displayed */ Q_ADJACENT_COUNTIES = `` /* 245-byte string literal not displayed */ Q_LAST_50_HIT_IDS = `select id from hits order by entdate desc, id desc limit 50` Q_LAST_50_DENOM_SERIES = ` select b.%s, count(1) from bills b, hits h where b.id=h.bill_id and h.id in (` + Q_LAST_50_HIT_IDS + `) group by b.%s order by b.%s ` Q_LAST_50_STATES = ` select cm.state, count(1) from hits h, counties_master cm where h.id in (` + Q_LAST_50_HIT_IDS + `) and cm.id = h.county_id and country = 'US' group by cm.state union select state, count(1) from hits where id in (` + Q_LAST_50_HIT_IDS + `) and country = 'Canada' group by state union select country, count(1) from hits where id in (` + Q_LAST_50_HIT_IDS + `) and country not in ('US', 'Canada') group by country order by count desc, state asc ` Q_LAST_50_COUNTIES = ` select cm.state, cm.county, count(1) from hits h, counties_master cm where h.id in (` + Q_LAST_50_HIT_IDS + `) and cm.id = h.county_id and country = 'US' group by cm.state, cm.county union select state, city, count(1) from hits where id in (` + Q_LAST_50_HIT_IDS + `) and country = 'Canada' group by state, city union select country, city, count(1) from hits where id in (` + Q_LAST_50_HIT_IDS + `) and country not in ('US', 'Canada') group by country, city order by count desc, state asc, county asc ` Q_HITS_CALENDAR = ` select substr(entdate::text, 6) as date, count(1) from hits group by date ` SERIAL_RE_BASE = `[A-L][0-9\-]{8}[A-NP-Y\*]$` )
Variables ¶
View Source
var ( // AppVersion revel app version (ldflags) AppVersion string // BuildTime revel app build-time (ldflags) BuildTime string // my vars SeriesByLetter map[string]string )
View Source
var ( RE_dbUnsafe *re.Regexp RE_singleQuote *re.Regexp RE_whitespace *re.Regexp RE_leadingWhitespace *re.Regexp RE_trailingWhitespace *re.Regexp RE_serial *re.Regexp RE_serial_10 *re.Regexp RE_serial_11 *re.Regexp RE_series *re.Regexp RE_trailingCommas *re.Regexp RE_date *re.Regexp RE_nonNumeric *re.Regexp )
View Source
var DB *sql.DB
View Source
var Environment string
View Source
var HeaderFilter = func(c *revel.Controller, fc []revel.Filter) {
c.Response.Out.Header().Add("X-Frame-Options", "SAMEORIGIN")
c.Response.Out.Header().Add("X-XSS-Protection", "1; mode=block")
c.Response.Out.Header().Add("X-Content-Type-Options", "nosniff")
c.Response.Out.Header().Add("Referrer-Policy", "strict-origin-when-cross-origin")
fc[0](c, fc[1:])
}
HeaderFilter adds common security headers There is a full implementation of a CSRF filter in https://github.com/revel/modules/tree/master/csrf
Functions ¶
func InitSeries ¶
func InitSeries()
Types ¶
type DateSelData ¶
type DayOfMonth ¶
type DualRegionBrkEnt ¶
type HitsBrkEnt ¶
Click to show internal directories.
Click to hide internal directories.