model

package
v0.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 12, 2024 License: GPL-3.0 Imports: 29 Imported by: 0

Documentation

Overview

Package model provides a database model for the Defacto2 website.

Index

Constants

View Source
const (
	ShortLimit   = 100 // ShortLimit is the maximum length of a short string.
	LongFilename = 255 // LongFilename is the maximum length of a filename.
)
View Source
const ClauseNoSoftDel = "deletedat IS NULL"

ClauseNoSoftDel is the clause to exclude soft deleted records.

View Source
const ClauseOldDate = "date_issued_year ASC NULLS LAST, " +
	"date_issued_month ASC NULLS LAST, " +
	"date_issued_day ASC NULLS LAST"

ClauseOldDate orders the records by oldest date first.

View Source
const EpochYear = 1980

EpochYear is the epoch year for the website, ie. the year 0 of the MS-DOS era.

View Source
const From = "files"

From is the name of the table containing records of files.

View Source
const Maximum = 998

Maximum number of files to return per query.

Variables

View Source
var (
	ErrColumn   = errors.New("column not implemented")
	ErrDay      = errors.New("invalid day")
	ErrDB       = errors.New("database value is nil")
	ErrID       = errors.New("file download database id cannot be found")
	ErrKey      = errors.New("key value is zero or negative")
	ErrModel    = errors.New("error, no file model")
	ErrMonth    = errors.New("invalid month")
	ErrName     = errors.New("name value is empty")
	ErrOrderBy  = errors.New("order by value is invalid")
	ErrSize     = errors.New("size value is invalid")
	ErrRels     = errors.New("too many releasers, only two are allowed")
	ErrPlatform = errors.New("invalid platform")
	ErrSha384   = errors.New("sha384 value is invalid")
	ErrTime     = errors.New("time value is invalid")
	ErrURI      = errors.New("uri value is invalid")
	ErrUUID     = errors.New("could not create a new universial unique identifier")
	ErrYear     = errors.New("invalid year")
)

Functions

func CategoryByteSum

func CategoryByteSum(ctx context.Context, db *sql.DB, name string) (int64, error)

CategoryByteSum sums the byte file sizes for all the files that match the named category.

func CategoryCount

func CategoryCount(ctx context.Context, db *sql.DB, name string) (int64, error)

CategoryCount counts the files that match the named category.

func ClassificationCount

func ClassificationCount(ctx context.Context, db *sql.DB, section, platform string) (int64, error)

ClassificationCount counts the files that match the named category and platform.

func DemozooExists

func DemozooExists(ctx context.Context, db *sql.DB, id int64) (bool, error)

DemozooExists returns true if the file record exists in the database using a Demozoo production ID. This function will also return true for records that have been marked as deleted.

func Edit

func Edit(key int) (*models.File, error)

Edit retrieves a single file record from the database using the record key. This function will also return records that have been marked as deleted.

Deprecated?

func FileExists

func FileExists(ctx context.Context, db *sql.DB, id int64) (bool, error)

FileExists returns true if the file record exists in the database. This function will also return true for records that have been marked as deleted.

func HashExists

func HashExists(ctx context.Context, db *sql.DB, hash string) (bool, error)

HashExists returns true if the file record exists in the database using a SHA-384 hexadecimal hash.

func InsertDemozoo

func InsertDemozoo(ctx context.Context, db *sql.DB, id int64) (int64, error)

InsertDemozoo inserts a new file record into the database using a Demozoo production ID. This will not check if the Demozoo production ID already exists in the database. When successful the function will return the new record ID.

func InsertPouet

func InsertPouet(ctx context.Context, db *sql.DB, id int64) (int64, error)

InsertPouet inserts a new file record into the database using a Pouet production ID. This will not check if the Pouet production ID already exists in the database. When successful the function will return the new record ID.

func InsertUpload

func InsertUpload(ctx context.Context, tx *sql.Tx, values url.Values, key string) (int64, uuid.UUID, error)

InsertUpload inserts a new file record into the database using a URL values map. This will not check if the file already exists in the database. Invalid values will be ignored, but will not prevent the record from being inserted. When successful the function will return the new record ID key and the UUID.

func JsDosBinary

func JsDosBinary(f *models.File) (string, error)

JsDosBinary returns the program executable to run in the js-dos emulator. If the dosee_run_program is set then it is the preferred executable. If the filename is a .com or .exe then it will return the filename. Otherwise, it will attempt to find the most likely executable in the archive.

func JsDosConfig

func JsDosConfig(f *models.File) (string, error)

JsDosConfig creates a js-dos .ini configuration for the emulator.

func NewV7

func NewV7() (time.Time, uuid.UUID, error)

NewV7 generates a new UUID version 7, if that fails then it will fallback to version 1. It also returns the current time.

func One

func One(ctx context.Context, db *sql.DB, deleted bool, key int) (*models.File, error)

One retrieves the single file record for the key ID.

func OneByUUID

func OneByUUID(ctx context.Context, db *sql.DB, deleted bool, uid string) (*models.File, error)

OneByUUID returns the record associated with the UUID key. Generally this method of retrieval is less efficient than using the numeric, record key ID.

func OneDemozoo

func OneDemozoo(ctx context.Context, db *sql.DB, id int64) (bool, int64, error)

OneDemozoo retrieves the ID or key of a single file record from the database using a Demozoo production ID. This function will also return records that have been marked as deleted and flag those with the boolean. If the record is not found then the function will return an ID of 0 but without an error.

func OneEditByKey

func OneEditByKey(key string) (*models.File, error)

OneEditByKey retrieves a single file record from the database using the obfuscated record key. This function will also return records that have been marked as deleted.

func OneFile

func OneFile(ctx context.Context, db *sql.DB, id int64) (*models.File, error)

OneFile retrieves a single file record from the database using the record key. This function will also return records that have been marked as deleted.

func OneFileByKey

func OneFileByKey(key string) (*models.File, error)

OneFileByKey retrieves a single file record from the database using the obfuscated record key.

func OnePouet

func OnePouet(ctx context.Context, db *sql.DB, id int64) (bool, int64, error)

OnePouet retrieves the ID or key of a single file record from the database using a Pouet production ID. This function will also return records that have been marked as deleted and flag those with the boolean. If the record is not found then the function will return an ID of 0 but without an error.

func PlatformByteSum

func PlatformByteSum(ctx context.Context, db *sql.DB, name string) (int64, error)

PlatformByteSum sums the byte filesizes for all the files that match the category name.

func PlatformCount

func PlatformCount(ctx context.Context, db *sql.DB, name string) (int64, error)

PlatformCount counts the files that match the named platform.

func PouetExists

func PouetExists(ctx context.Context, db *sql.DB, id int64) (bool, error)

PouetExists returns true if the file record exists in the database using a Pouet production ID. This function will also return true for records that have been marked as deleted.

func ReleaserByteSum

func ReleaserByteSum(ctx context.Context, db *sql.DB, name string) (int64, error)

ReleaserByteSum sums the byte file sizes for all the files that match the group name.

func SHA384Exists

func SHA384Exists(ctx context.Context, db *sql.DB, sha384 []byte) (bool, error)

SHA384Exists returns true if the file record exists in the database using a SHA-384 hash.

func Update16Colors

func Update16Colors(id int64, val string) error

Update16Colors updates the WebID16colors column value with val.

func UpdateClassification

func UpdateClassification(id int64, platform, tag string) error

UpdateClassification updates the classification of a file in the database. It takes an ID, platform, and tag as parameters and returns an error if any. Both platform and tag must be valid values.

func UpdateComment

func UpdateComment(id int64, val string) error

UpdateComment updates the Comment column value with val.

func UpdateCreatorAudio

func UpdateCreatorAudio(id int64, val string) error

UpdateCreatorAudio updates the CreditAudio column with val.

func UpdateCreatorIll

func UpdateCreatorIll(id int64, val string) error

UpdateCreatorIll updates the CreditIllustration column with val.

func UpdateCreatorProg

func UpdateCreatorProg(id int64, val string) error

UpdateCreatorProg updates the CreditProgram column with val.

func UpdateCreatorText

func UpdateCreatorText(id int64, val string) error

UpdateCreatorText updates the CreditText column with val.

func UpdateCreators

func UpdateCreators(id int64, text, ill, prog, audio string) error

UpdateCreators updates the text, illustration, program, and audio credit columns with the values provided.

func UpdateDateIssued

func UpdateDateIssued(id int64, y, m, d string) error

UpdateDateIssued updates the date issued year, month and day columns with the values provided. Columns updated are DateIssuedYear, DateIssuedMonth, and DateIssuedDay.

func UpdateDemozoo

func UpdateDemozoo(id int64, val string) error

UpdateDemozoo updates the WebIDDemozoo column with val.

func UpdateFilename

func UpdateFilename(id int64, val string) error

UpdateFilename updates the Filename column with val.

func UpdateGitHub

func UpdateGitHub(id int64, val string) error

UpdateGitHub updates the WebIDGithub column with val.

func UpdateInt64From

func UpdateInt64From(column int64From, id int64, val string) error

UpdateInt64From updates the column int64 from value with val. The int64From columns are table columns that can either be null, empty, or have an int64 value. The demoZooProd and pouetProd values are also validated to be within a sane range.

func UpdateNoReadme

func UpdateNoReadme(id int64, val bool) error

UpdateNoReadme updates the retrotxt_no_readme column value with val. It returns nil if the update was successful. Id is the database id of the record.

func UpdateOffline

func UpdateOffline(id int64) error

UpdateOffline updates the record to be offline and inaccessible to the public.

func UpdateOnline

func UpdateOnline(id int64) error

UpdateOnline updates the record to be online and public.

func UpdatePlatform

func UpdatePlatform(id int64, val string) error

UpdatePlatform updates the Platform column value with val.

func UpdatePouet

func UpdatePouet(id int64, val string) error

UpdatePouet updates the WebIDPouet column with val.

func UpdateRelations

func UpdateRelations(id int64, val string) error

UpdateRelations updates the ListRelations column value with val.

func UpdateReleasers

func UpdateReleasers(id int64, val string) error

UpdateReleasers updates the releasers values with val. Two releases can be separated by a + (plus) character. The columns updated are GroupBrandFor and GroupBrandBy.

func UpdateSites

func UpdateSites(id int64, val string) error

UpdateSites updates the ListLinks column with val.

func UpdateStringFrom

func UpdateStringFrom(column stringFrom, id int64, val string) error

UpdateStringFrom updates the column string from value with val. The stringFrom columns are table columns that can either be null, empty, or have a string value.

func UpdateTag

func UpdateTag(id int64, val string) error

UpdateTag updates the Section column with val.

func UpdateTitle

func UpdateTitle(id int64, val string) error

UpdateTitle updates the RecordTitle column with val.

func UpdateVirusTotal

func UpdateVirusTotal(id int64, val string) error

UpdateVirusTotal updates the FileSecurityAlertURL value with val.

func UpdateYMD

func UpdateYMD(id int64, y, m, d null.Int16) error

func UpdateYouTube

func UpdateYouTube(id int64, val string) error

UpdateYouTube updates the WebIDYoutube column value with val.

func ValidD

func ValidD(d int16) null.Int16

ValidD returns a valid day or a null value.

func ValidDateIssue

func ValidDateIssue(y, m, d string) (null.Int16, null.Int16, null.Int16)

ValidDateIssue returns a valid year, month and day or a null value.

func ValidFilename

func ValidFilename(s string) null.String

ValidFilename returns a valid filename or a null value. The filename is trimmed and shortened to the long filename limit.

func ValidFilesize

func ValidFilesize(size string) (uint64, error)

ValidFilesize returns a valid file size or an error. The file size is parsed as an unsigned integer. An error is returned if the string cannot be parsed as an integer.

func ValidIntegrity

func ValidIntegrity(integrity string) null.String

ValidIntegrity confirms the integrity as a valid SHA-384 hexadecimal hash or returns a null value.

func ValidLastMod

func ValidLastMod(lastmod string) null.Time

ValidLastMod returns a valid last modified time or a null value. The lastmod time is parsed as a Unix time in milliseconds. An error is returned if the string cannot be parsed as an integer. The lastmod time is validated to be within the current year and the epoch year of 1980.

func ValidM

func ValidM(m int16) null.Int16

ValidM returns a valid month or a null value.

func ValidMagic

func ValidMagic(mediatype string) null.String

ValidMagic returns a valid media type or a null value. It is validated using the mime package. The media type is trimmed and validated using the mime package.

func ValidPlatform

func ValidPlatform(platform string) null.String

ValidPlatform returns a valid platform or a null value.

func ValidReleasers

func ValidReleasers(s1, s2 string) (null.String, null.String)

ValidReleasers returns two valid releaser group strings or null values.

func ValidSceners

func ValidSceners(s string) null.String

ValidSceners returns a valid sceners string or a null value.

func ValidSection

func ValidSection(section string) null.String

ValidSection returns a valid section or a null value.

func ValidString

func ValidString(s string) null.String

ValidString returns a valid string or a null value.

func ValidTitle

func ValidTitle(s string) null.String

ValidTitle returns a valid title or a null value. The title is trimmed and shortened to the short limit.

func ValidY

func ValidY(y int16) null.Int16

ValidY returns a valid year or a null value.

func ValidYouTube

func ValidYouTube(s string) (null.String, error)

ValidYouTube returns true if the string is a valid YouTube video ID. An error is only returned if the regular expression match cannot compile.

Types

type Advert struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

Advert is a the model for the for sale.

func (*Advert) List

func (a *Advert) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*Advert) Stat

func (a *Advert) Stat(ctx context.Context, db *sql.DB) error

type Announcement

type Announcement struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

Announcement is a the model for the public and community announcements.

func (*Announcement) List

func (a *Announcement) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*Announcement) Stat

func (a *Announcement) Stat(ctx context.Context, db *sql.DB) error

type Ansi

type Ansi struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

Ansi is a the model for the ANSI formatted text and art files.

func (*Ansi) List

func (a *Ansi) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*Ansi) Stat

func (a *Ansi) Stat(ctx context.Context, db *sql.DB) error

type AnsiBBS

type AnsiBBS struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

AnsiBBS is a the model for the BBS advertisements created in ANSI text.

func (*AnsiBBS) List

func (a *AnsiBBS) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*AnsiBBS) Stat

func (a *AnsiBBS) Stat(ctx context.Context, db *sql.DB) error

type AnsiBrand

type AnsiBrand struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

AnsiBrand is a the model for the brand logos created in ANSI text.

func (*AnsiBrand) List

func (a *AnsiBrand) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*AnsiBrand) Stat

func (a *AnsiBrand) Stat(ctx context.Context, db *sql.DB) error

type AnsiFTP

type AnsiFTP struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

AnsiFTP is a the model for the FTP advertisements created in ANSI text.

func (*AnsiFTP) List

func (a *AnsiFTP) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*AnsiFTP) Stat

func (a *AnsiFTP) Stat(ctx context.Context, db *sql.DB) error

type AnsiNfo

type AnsiNfo struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

AnsiNfo is a the model for the NFO files created in ANSI text.

func (*AnsiNfo) List

func (a *AnsiNfo) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*AnsiNfo) Stat

func (a *AnsiNfo) Stat(ctx context.Context, db *sql.DB) error

type AnsiPack

type AnsiPack struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

AnsiPack is a the model for the ANSI file packs.

func (*AnsiPack) List

func (a *AnsiPack) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*AnsiPack) Stat

func (a *AnsiPack) Stat(ctx context.Context, db *sql.DB) error

type Artifacts

type Artifacts struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

Artifacts contain statistics for every artifact.

func (*Artifacts) ByForApproval

func (f *Artifacts) ByForApproval(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

ByForApproval returns all of the file records that are waiting to be marked for approval.

func (*Artifacts) ByHidden

func (f *Artifacts) ByHidden(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

ByHidden returns all of the file records that are hidden ~ soft deleted.

func (*Artifacts) ByKey

func (f *Artifacts) ByKey(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

ByKey returns the public files reversed ordered by the ID, key column.

func (*Artifacts) ByNewest

func (f *Artifacts) ByNewest(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

ByNewest returns all of the file records sorted by the date issued.

func (*Artifacts) ByOldest

func (f *Artifacts) ByOldest(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

ByOldest returns all of the file records sorted by the date issued.

func (*Artifacts) ByUnwanted

func (f *Artifacts) ByUnwanted(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

ByUnwanted returns all of the file records that are flagged by Google as unwanted.

func (*Artifacts) ByUpdated

func (f *Artifacts) ByUpdated(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

ByUpdated returns all of the file records sorted by the date updated.

func (*Artifacts) Description

func (f *Artifacts) Description(ctx context.Context, db *sql.DB, terms []string) (models.FileSlice, error)

Description returns a list of files that match the search terms. The search terms are matched against the record_title column. The results are ordered by the filename column in ascending order.

func (*Artifacts) Filename

func (f *Artifacts) Filename(ctx context.Context, db *sql.DB, terms []string) (models.FileSlice, error)

Filename returns a list of files that match the search terms. The search terms are matched against the filename column. The results are ordered by the filename column in ascending order.

func (*Artifacts) Public

func (f *Artifacts) Public(ctx context.Context, db *sql.DB) error

Public returns the total number of artifacts and the summed filesize of all artifacts that are not hidden.

type BBS

type BBS struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

BBS is a the model for the Bulletin Board System files.

func (*BBS) List

func (b *BBS) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*BBS) Stat

func (b *BBS) Stat(ctx context.Context, db *sql.DB) error

type BBSImage

type BBSImage struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

BBSImage is a the model for the Bulletin Board System image files.

func (*BBSImage) List

func (b *BBSImage) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*BBSImage) Stat

func (b *BBSImage) Stat(ctx context.Context, db *sql.DB) error

type BBSText

type BBSText struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

BBSText is a the model for the Bulletin Board System text files.

func (*BBSText) List

func (b *BBSText) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*BBSText) Stat

func (b *BBSText) Stat(ctx context.Context, db *sql.DB) error

type BBStro

type BBStro struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

BBStro is a the model for the Bulletin Board System intro files.

func (*BBStro) List

func (b *BBStro) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*BBStro) Stat

func (b *BBStro) Stat(ctx context.Context, db *sql.DB) error

type Database

type Database struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

Database is a the model for the database releases.

func (*Database) List

func (d *Database) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*Database) Stat

func (d *Database) Stat(ctx context.Context, db *sql.DB) error

type Demoscene

type Demoscene struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

Demoscene is a the model for the demoscene releases.

func (*Demoscene) List

func (d *Demoscene) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*Demoscene) Stat

func (d *Demoscene) Stat(ctx context.Context, db *sql.DB) error

type Drama

type Drama struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

Drama is the model for community drama.

func (*Drama) List

func (d *Drama) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*Drama) Stat

func (d *Drama) Stat(ctx context.Context, db *sql.DB) error

type FTP

type FTP struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

FTP is a the model for the FTP files.

func (*FTP) List

func (f *FTP) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*FTP) Stat

func (f *FTP) Stat(ctx context.Context, db *sql.DB) error

type HTML

type HTML struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

HTML is a the model for the HTML and markdown files.

func (*HTML) List

func (h *HTML) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*HTML) Stat

func (h *HTML) Stat(ctx context.Context, db *sql.DB) error

type Hack

type Hack struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

Hack is a the model for the game hacks.

func (*Hack) List

func (h *Hack) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*Hack) Stat

func (h *Hack) Stat(ctx context.Context, db *sql.DB) error

type HowTo

type HowTo struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

HowTo is a the model for the guides and how-tos.

func (*HowTo) List

func (h *HowTo) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*HowTo) Stat

func (h *HowTo) Stat(ctx context.Context, db *sql.DB) error

type Image

type Image struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

Image is a the model for the images.

func (*Image) List

func (i *Image) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*Image) Stat

func (i *Image) Stat(ctx context.Context, db *sql.DB) error

type ImagePack

type ImagePack struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

ImagePack is a the model for the image file packs.

func (*ImagePack) List

func (i *ImagePack) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*ImagePack) Stat

func (i *ImagePack) Stat(ctx context.Context, db *sql.DB) error

type Installer

type Installer struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

Installer contain statistics for releases that could be considered installers.

func (*Installer) List

func (i *Installer) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*Installer) Stat

func (i *Installer) Stat(ctx context.Context, db *sql.DB) error

type Intro

type Intro struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

Intro contain statistics for releases that could be considered intros or cracktros.

func (*Intro) List

func (i *Intro) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*Intro) Stat

func (i *Intro) Stat(ctx context.Context, db *sql.DB) error

type IntroMsDos

type IntroMsDos struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

IntroMsDos contain statistics for releases that could be considered DOS intros or cracktros.

func (*IntroMsDos) List

func (i *IntroMsDos) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*IntroMsDos) Stat

func (i *IntroMsDos) Stat(ctx context.Context, db *sql.DB) error

type IntroWindows

type IntroWindows struct {
	Cache   time.Time
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

IntroWindows contain statistics for releases that could be considered Windows intros or cracktros.

func (*IntroWindows) List

func (i *IntroWindows) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*IntroWindows) Stat

func (i *IntroWindows) Stat(ctx context.Context, db *sql.DB) error

type Java

type Java struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

Java is a the model for the Java operating system.

func (*Java) List

func (j *Java) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*Java) Stat

func (j *Java) Stat(ctx context.Context, db *sql.DB) error

type JobAdvert

type JobAdvert struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

JobAdvert is a the model for group job advertisements.

func (*JobAdvert) List

func (j *JobAdvert) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*JobAdvert) Stat

func (j *JobAdvert) Stat(ctx context.Context, db *sql.DB) error

type Linux

type Linux struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

Linux is a the model for the Linux operating system.

func (*Linux) List

func (l *Linux) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*Linux) Stat

func (l *Linux) Stat(ctx context.Context, db *sql.DB) error

type Macos

type Macos struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

Macos is a the model for the Macintosh operating system.

func (*Macos) List

func (m *Macos) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*Macos) Stat

func (m *Macos) Stat(ctx context.Context, db *sql.DB) error

type Magazine

type Magazine struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

Magazine is a the model for the magazine files.

func (*Magazine) List

func (m *Magazine) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*Magazine) Stat

func (m *Magazine) Stat(ctx context.Context, db *sql.DB) error

type MsDos

type MsDos struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

MsDos is a the model for the MS-DOS operating system.

func (*MsDos) List

func (d *MsDos) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*MsDos) Stat

func (d *MsDos) Stat(ctx context.Context, db *sql.DB) error

type MsDosPack

type MsDosPack struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

MsDosPack is a the model for the DOS file packs.

func (*MsDosPack) List

func (d *MsDosPack) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*MsDosPack) Stat

func (d *MsDosPack) Stat(ctx context.Context, db *sql.DB) error

type Music

type Music struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

Music is a the model for the music.

func (*Music) List

func (m *Music) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*Music) Stat

func (m *Music) Stat(ctx context.Context, db *sql.DB) error

type NewsArticle

type NewsArticle struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

NewsArticle is a the model for mainstream news articles.

func (*NewsArticle) List

func (n *NewsArticle) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*NewsArticle) Stat

func (n *NewsArticle) Stat(ctx context.Context, db *sql.DB) error

type Nfo

type Nfo struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

Nfo is a the model for the NFO files.

func (*Nfo) List

func (n *Nfo) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*Nfo) Stat

func (n *Nfo) Stat(ctx context.Context, db *sql.DB) error

type NfoTool

type NfoTool struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

NfoTool is a the model for the NFO tools.

func (*NfoTool) List

func (n *NfoTool) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*NfoTool) Stat

func (n *NfoTool) Stat(ctx context.Context, db *sql.DB) error

type OrderBy

type OrderBy uint

OrderBy is the sorting order for ALL the releasers.

const (
	Prolific     OrderBy = iota // Prolific orders by the total artifact count.
	Alphabetical                // Alphabetical orders by the releaser name.
	Oldest                      // Oldest orders by the year of the first artifact.
)

type PDF

type PDF struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

PDF is a the model for the documents in PDF format.

func (*PDF) List

func (p *PDF) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*PDF) Stat

func (p *PDF) Stat(ctx context.Context, db *sql.DB) error

type Proof

type Proof struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

Proof is a the model for the file proofs.

func (*Proof) List

func (p *Proof) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*Proof) Stat

func (p *Proof) Stat(ctx context.Context, db *sql.DB) error

type Releaser

type Releaser struct {
	Name  string `boil:"releaser"`   // Name of the releaser.
	URI   string ``                  // URI slug for the releaser, with no boiler bind.
	Bytes int    `boil:"size_total"` // Bytes are the total size of all the files under this releaser.
	Count int    `boil:"count_sum"`  // Count is the total number of files under this releaser.
	// Year is used for optional sorting and is the earliest year the releaser was active.
	Year null.Int `boil:"min_year"`
}

Releaser is a collective, group or individual, that releases files.

type ReleaserName

type ReleaserName struct {
	Name string `boil:"releaser"`
}

ReleaserName is a releaser name.

type ReleaserNames

type ReleaserNames []ReleaserName

ReleaserNames is a distinct data list of releasers.

func (*ReleaserNames) Distinct

func (r *ReleaserNames) Distinct(ctx context.Context, db *sql.DB) error

Distinct gets the unique releaser names.

type Releasers

type Releasers []*struct {
	Unique Releaser `boil:",bind"` // Unique releaser.
}

Releasers is a collection of releasers.

func (*Releasers) BBS

func (r *Releasers) BBS(ctx context.Context, db *sql.DB, order OrderBy) error

BBS gets the unique BBS site names and their total file count and file sizes.

func (*Releasers) FTP

func (r *Releasers) FTP(ctx context.Context, db *sql.DB) error

FTP gets the unique FTP site names and their total file count and file sizes.

func (*Releasers) Limit

func (r *Releasers) Limit(ctx context.Context, db *sql.DB, order OrderBy, limit, page int) error

Limit gets the unique releaser names and their total file count and file sizes. When reorder is true the results are ordered by the total file counts.

func (*Releasers) Magazine

func (r *Releasers) Magazine(ctx context.Context, db *sql.DB) error

Magazine gets the unique magazine titles and their total issue count and file sizes.

func (*Releasers) MagazineAZ

func (r *Releasers) MagazineAZ(ctx context.Context, db *sql.DB) error

Magazine gets the unique magazine titles and their total issue count and file sizes.

func (*Releasers) Similar

func (r *Releasers) Similar(ctx context.Context, db *sql.DB, limit uint, names ...string) error

Similar finds the unique releaser names that are similar to the named strings. The results are ordered by the total file counts. The required limit is the maximum number of results to return or defaults to 10.

func (*Releasers) SimilarMagazine

func (r *Releasers) SimilarMagazine(ctx context.Context, db *sql.DB, limit uint, names ...string) error

SimilarMagazine finds the unique releaser names that are similar to the named strings. The results are ordered by the total file counts. The required limit is the maximum number of results to return or defaults to 10.

func (*Releasers) Slugs

func (r *Releasers) Slugs()

Slugs saves URL friendly strings to the Group names.

func (*Releasers) Where

func (r *Releasers) Where(ctx context.Context, db *sql.DB, name string) (models.FileSlice, error)

Where gets the records that match the named releaser.

type Restrict

type Restrict struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

func (*Restrict) List

func (r *Restrict) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*Restrict) Stat

func (r *Restrict) Stat(ctx context.Context, db *sql.DB) error

type Scener

type Scener string

Scener is a collective, group or individual, that releases files.

func (*Scener) Where

func (s *Scener) Where(ctx context.Context, db *sql.DB, name string) (models.FileSlice, error)

Where gets the records of all files that have been credited to the named scener.

type Sceners

type Sceners []*struct {
	Name Scener `boil:"scener"`
}

Sceners is a collection of sceners.

func (*Sceners) Artist

func (s *Sceners) Artist(ctx context.Context, db *sql.DB) error

Artist gets a list of sceners who have been credited for graphics or art.

func (*Sceners) Coder

func (s *Sceners) Coder(ctx context.Context, db *sql.DB) error

Coder gets a list of sceners who have been credited for programming.

func (*Sceners) Distinct

func (s *Sceners) Distinct(ctx context.Context, db *sql.DB) error

Distinct gets a list of all, distinct sceners.

func (*Sceners) Musician

func (s *Sceners) Musician(ctx context.Context, db *sql.DB) error

Musician gets a list of sceners who have been credited for music or audio.

func (Sceners) Sort

func (s Sceners) Sort() []string

Sort gets a sorted slice of unique sceners.

func (*Sceners) Writer

func (s *Sceners) Writer(ctx context.Context, db *sql.DB) error

Writer gets a list of sceners who have been credited for text.

type Script

type Script struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

Script is a the model for the script and interpreted languages.

func (*Script) List

func (s *Script) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*Script) Stat

func (s *Script) Stat(ctx context.Context, db *sql.DB) error

type Standard

type Standard struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

Standard is a the model for community standards.

func (*Standard) List

func (s *Standard) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*Standard) Stat

func (s *Standard) Stat(ctx context.Context, db *sql.DB) error

type Summary

type Summary struct {
	SumBytes sql.NullInt64 `boil:"size_total"`  // Sum total of the file sizes.
	SumCount sql.NullInt64 `boil:"count_total"` // Sum total count of the files.
	MinYear  sql.NullInt16 `boil:"min_year"`    // Minimum or earliest year of the files.
	MaxYear  sql.NullInt16 `boil:"max_year"`    // Maximum or latest year of the files.
}

Summary counts the total number files, file sizes and the earliest and latest years.

func (*Summary) ByDescription

func (s *Summary) ByDescription(ctx context.Context, db *sql.DB, terms []string) error

ByDescription saves the summary statistics for the file description search.

func (*Summary) ByFilename

func (s *Summary) ByFilename(ctx context.Context, db *sql.DB, terms []string) error

ByFilename saves the summary statistics for the filename search.

func (*Summary) ByForApproval

func (s *Summary) ByForApproval(ctx context.Context, db *sql.DB) error

ByForApproval returns the summary statistics for files that require approval.

func (*Summary) ByHidden

func (s *Summary) ByHidden(ctx context.Context, db *sql.DB) error

ByHidden returns the summary statistics for files that have been deleted.

func (*Summary) ByMatch

func (s *Summary) ByMatch(ctx context.Context, db *sql.DB, uri string) error

ByMatch returns the summary statistics for the named uri.

func (*Summary) ByPublic

func (s *Summary) ByPublic(ctx context.Context, db *sql.DB) error

ByPublic selects the summary statistics for all public files.

func (*Summary) ByReleaser

func (s *Summary) ByReleaser(ctx context.Context, db *sql.DB, name string) error

ByReleaser returns the summary statistics for the named releaser. The name is case insensitive and should be the URI slug of the releaser.

func (*Summary) ByScener

func (s *Summary) ByScener(ctx context.Context, db *sql.DB, name string) error

ByScener selects the summary statistics for the named sceners.

func (*Summary) ByUnwanted

func (s *Summary) ByUnwanted(ctx context.Context, db *sql.DB) error

ByUnwanted returns the summary statistics for files that have been marked as unwanted.

type Takedown

type Takedown struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

Takedown is a the model for the bust and takedowns.

func (*Takedown) List

func (t *Takedown) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*Takedown) Stat

func (t *Takedown) Stat(ctx context.Context, db *sql.DB) error

type Text

type Text struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

Text is a the model for the text files.

func (*Text) List

func (t *Text) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*Text) Stat

func (t *Text) Stat(ctx context.Context, db *sql.DB) error

type TextAmiga

type TextAmiga struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

TextAmiga is a the model for the text files for the Amiga operating system.

func (*TextAmiga) List

func (t *TextAmiga) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*TextAmiga) Stat

func (t *TextAmiga) Stat(ctx context.Context, db *sql.DB) error

type TextApple2

type TextApple2 struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

TextApple2 is a the model for the text files for the Apple II operating system.

func (*TextApple2) List

func (t *TextApple2) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*TextApple2) Stat

func (t *TextApple2) Stat(ctx context.Context, db *sql.DB) error

type TextAtariST

type TextAtariST struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

TextAtariST is a the model for the text files for the Atari ST operating system.

func (*TextAtariST) List

func (t *TextAtariST) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*TextAtariST) Stat

func (t *TextAtariST) Stat(ctx context.Context, db *sql.DB) error

type TextPack

type TextPack struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

TextPack is a the model for the text file packs.

func (*TextPack) List

func (t *TextPack) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*TextPack) Stat

func (t *TextPack) Stat(ctx context.Context, db *sql.DB) error

type Tool

type Tool struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

Tool is a the model for the computer tools.

func (*Tool) List

func (t *Tool) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*Tool) Stat

func (t *Tool) Stat(ctx context.Context, db *sql.DB) error

type TrialCrackme

type TrialCrackme struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

TrialCrackme is a the model for group job trial crackme releases.

func (*TrialCrackme) List

func (t *TrialCrackme) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*TrialCrackme) Stat

func (t *TrialCrackme) Stat(ctx context.Context, db *sql.DB) error

type Video

type Video struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

Video is a the model for the videos.

func (*Video) List

func (v *Video) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*Video) Stat

func (v *Video) Stat(ctx context.Context, db *sql.DB) error

type Windows

type Windows struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

Windows is a the model for the Windows operating system.

func (*Windows) List

func (w *Windows) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*Windows) Stat

func (w *Windows) Stat(ctx context.Context, db *sql.DB) error

type WindowsPack

type WindowsPack struct {
	Bytes   int `boil:"size_total"`
	Count   int `boil:"count_total"`
	MinYear int `boil:"min_year"`
	MaxYear int `boil:"max_year"`
}

WindowsPack is a the model for the Windows file packs.

func (*WindowsPack) List

func (w *WindowsPack) List(ctx context.Context, db *sql.DB, offset, limit int) (models.FileSlice, error)

func (*WindowsPack) Stat

func (w *WindowsPack) Stat(ctx context.Context, db *sql.DB) error

Directories

Path Synopsis
Package expr provides the query mod expressions for the file database.
Package expr provides the query mod expressions for the file database.
Package fix contains functions for repairing the database data.
Package fix contains functions for repairing the database data.
Package htm3 is a sub-package of the model package that should only be used by the html3 handler.
Package htm3 is a sub-package of the model package that should only be used by the html3 handler.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL