Documentation
¶
Overview ¶
Package jobtags checks a job's tags. The hopper package checks an insert's and a listing's tags with it, and hoppertest those of a job it runs, so that a test accepts only the tags an insert would.
Index ¶
Constants ¶
const ( MaxBytes = 255 Max = 64 )
MaxBytes is the longest tag, and Max the most distinct tags a job may have. hopper exports them as MaxTagBytes and MaxTags.
Variables ¶
This section is empty.
Functions ¶
func Check ¶
Check validates a job's tags and drops repeats, keeping the first of each. It returns nil for none.
func CheckOne ¶
CheckOne validates one tag: 1 to MaxBytes bytes of valid UTF-8 without control characters.
func Distinct ¶
Distinct returns tags without repeats, keeping the first of each, or nil for none: the tags a job with them has, and those a listing walks.
func DistinctAtMost ¶
DistinctAtMost is Distinct that gives up, reporting false, once it has found more than n distinct tags, so that a long list costs a check of n tags each rather than one of every tag against every other. Past Max distinct tags, which only a row a direct SQL write stored can hold (a scan reads it with Distinct), repeats are found with a set, so that such a row costs its length rather than its square.
Types ¶
This section is empty.