Documentation ¶
Overview ¶
Package htm3 is a sub-package of the model package that should only be used by the html3 handler. It contains the database queries for the HTML3 templates used to display the file lists in a table format.
Index ¶
- Constants
- Variables
- func ArtExpr() qm.QueryMod
- func Created(f *models.File) string
- func DocumentExpr() qm.QueryMod
- func Icon(f *models.File) string
- func InvalidExec(exec boil.ContextExecutor) bool
- func LeadStr(width int, s string) string
- func Published(f *models.File) string
- func PublishedFW(width int, f *models.File) string
- func SelectHTML3() qm.QueryMod
- func SoftwareExpr() qm.QueryMod
- type Arts
- type Documents
- type Order
- func (o Order) Art(ctx context.Context, exec boil.ContextExecutor, offset, limit int) (models.FileSlice, error)
- func (o Order) ByCategory(ctx context.Context, exec boil.ContextExecutor, offset, limit int, name string) (models.FileSlice, error)
- func (o Order) ByGroup(ctx context.Context, exec boil.ContextExecutor, name string) (models.FileSlice, error)
- func (o Order) ByPlatform(ctx context.Context, exec boil.ContextExecutor, offset, limit int, name string) (models.FileSlice, error)
- func (o Order) Document(ctx context.Context, exec boil.ContextExecutor, offset, limit int) (models.FileSlice, error)
- func (o Order) Everything(ctx context.Context, exec boil.ContextExecutor, offset, limit int) (models.FileSlice, error)
- func (o Order) Software(ctx context.Context, exec boil.ContextExecutor, offset, limit int) (models.FileSlice, error)
- func (o Order) String() string
- type Softwares
Constants ¶
const ( // From is the name of the table containing records of files. From = "files" // ClauseNoSoftDel is the clause to exclude soft deleted records. ClauseNoSoftDel = "deletedat IS NULL" )
Variables ¶
var ( ErrDB = errors.New("database value is nil") ErrModel = errors.New("error, no file model") )
Functions ¶
func DocumentExpr ¶
DocumentExpr returns a query modifier for the document category.
func Icon ¶
Icon returns the extensionless name of a .gif image file to use as an icon for the filename. The icons are found in `public/image/html3/`.
func InvalidExec ¶ added in v0.14.0
func InvalidExec(exec boil.ContextExecutor) bool
InvalidExec returns true if the database context executor is invalid such as nil.
func Published ¶
Published takes optional DateIssuedYear, DateIssuedMonth and DateIssuedDay values and formats them into dd-mmm-yyyy string format. Depending on the context, any missing time values will be left blank or replaced with ?? question marks.
func PublishedFW ¶
PublishedFW formats the publication year, month and day to a fixed-width length w value.
func SelectHTML3 ¶
SelectHTML3 selects only the columns required by the HTML3 template.
func SoftwareExpr ¶
SoftwareExpr returns a query modifier for the software category.
Types ¶
type Arts ¶
type Arts struct { Bytes int `boil:"size_total"` // the total bytes of all the files Count int `boil:"count_total"` // the total number of files }
Arts statistics for releases that are digital or pixel art.
type Documents ¶
type Documents struct { Bytes int `boil:"size_total"` // the total bytes of all the files Count int `boil:"count_total"` // the total number of files }
Documents statistics for releases that are documents.
type Order ¶
type Order int
Order the query using a table column.
const ( NameAsc Order = iota // NameAsc order the ascending query using the filename. NameDes // NameDes order the descending query using the filename. PublAsc // PublAsc order the ascending query using the date published. PublDes // PublDes order the descending query using the date published. PostAsc // PostAsc order the ascending query using the date posted. PostDes // PostDes order the descending query using the date posted. SizeAsc // SizeAsc order the ascending query using the file size. SizeDes // SizeDes order the descending query using the file size. DescAsc // DescAsc order the ascending query using the record title. DescDes // DescDes order the descending query using the record title. )
func (Order) Art ¶
func (o Order) Art(ctx context.Context, exec boil.ContextExecutor, offset, limit int) (models.FileSlice, error)
Art returns all the files that could be considered as digital or pixel art.
func (Order) ByCategory ¶
func (o Order) ByCategory( ctx context.Context, exec boil.ContextExecutor, offset, limit int, name string) ( models.FileSlice, error, )
ByCategory returns all the files that match the named category.
func (Order) ByGroup ¶
func (o Order) ByGroup(ctx context.Context, exec boil.ContextExecutor, name string) (models.FileSlice, error)
ByGroup returns all the files that match an exact named group.
func (Order) ByPlatform ¶
func (o Order) ByPlatform( ctx context.Context, exec boil.ContextExecutor, offset, limit int, name string) ( models.FileSlice, error, )
ByPlatform returns all the files that match the named platform.
func (Order) Document ¶
func (o Order) Document(ctx context.Context, exec boil.ContextExecutor, offset, limit int) (models.FileSlice, error)
Document returns all the files that are considered to be documents.
func (Order) Everything ¶
func (o Order) Everything(ctx context.Context, exec boil.ContextExecutor, offset, limit int) (models.FileSlice, error)
Everything returns all of the file records.