Documentation
¶
Overview ¶
Package fileslice provides functions that return model FileSlices, which are multiple artifact records.
Index ¶
- Constants
- Variables
- func FileInfo(uri string) (logo, h1sub, lead string)
- func Records(ctx context.Context, exec boil.ContextExecutor, uri string, page, limit int) (models.FileSlice, error)
- func RecordsSub(uri string) string
- func Valid(path string) bool
- type Era
- type Item
- type Stats
- type URI
- type YearlyPoint
Constants ¶
const ( StatsTTL = 10 * time.Minute // Stats time to live YearlyMin = 1980 // YearlyMin is the first year included in the yearly release series. YearlyMax = 2010 // YearlyMax is the last year included in the yearly release series. )
const LastURI = _maxURI - 1
Variables ¶
var ( ErrCategory = errors.New("fileslice: unknown artifacts categories") ErrPagi = errors.New("fileslice: pagination page and limit cannot be less than 1") )
Functions ¶
func FileInfo ¶
FileInfo is a helper function for Files that returns the page title, h1 title and lead text.
func Records ¶
func Records(ctx context.Context, exec boil.ContextExecutor, uri string, page, limit int) (models.FileSlice, error)
Records returns the records for the artifacts category URI. Note that the record statistics and counts get cached.
func RecordsSub ¶
RecordsSub returns the records for the artifacts category URI.
Types ¶
type Era ¶
type Era struct {
Name string
MinYear int // MinYear is the earliest or founding year
MaxYear int // MaxYear is the most recent or final year
}
Era is used to provide sorted statistics for artifact categories.
type Stats ¶
type Stats struct {
Record model.Artifacts
Ansi model.Ansi
AnsiBBS model.AnsiBBS
BBS model.BBS
BBSText model.BBSText
BBStro model.BBStro
Console model.Console
Demoscene model.Demoscene
MsDos model.MsDos
Intro model.Intro
IntroD model.IntroMsDos
IntroW model.IntroWindows
Installer model.Installer
Java model.Java
Linux model.Linux
Magazine model.Magazine
Macos model.Macos
Nfo model.Nfo
NfoTool model.NfoTool
Proof model.Proof
Script model.Script
Text model.Text
Windows model.Windows
Yearly []YearlyPoint
}
Stats are the database statistics for the artifacts categories.
func Statistics ¶
func Statistics() Stats
Statistics returns the empty database statistics for the artifacts categories.
func (*Stats) Get ¶
Get and store the database statistics for the artifacts categories in a single scan.