Documentation ¶
Overview ¶
Package filerecord provides functions for the file model which is an artifact record.
Index ¶
- Constants
- func AlertURL(art *models.File) string
- func AttrArtist(art *models.File) string
- func AttrMusic(art *models.File) string
- func AttrProg(art *models.File) string
- func AttrWriter(art *models.File) string
- func Basename(art *models.File) string
- func Checksum(art *models.File) string
- func Comment(art *models.File) string
- func Date(art *models.File) template.HTML
- func Dates(art *models.File) (int16, int16, int16)
- func Description(art *models.File) string
- func DownloadID(art *models.File) string
- func EmbedReadme(art *models.File) bool
- func ExtraZip(art *models.File, extraDir string) bool
- func FileEntry(art *models.File) string
- func FirstHeader(art *models.File) string
- func Idenfication16C(art *models.File) string
- func IdenficationDZ(art *models.File) string
- func IdenficationGitHub(art *models.File) string
- func IdenficationPouet(art *models.File) string
- func IdenficationYT(art *models.File) string
- func JsdosArchive(art *models.File) bool
- func JsdosBroken(art *models.File) bool
- func JsdosCPU(art *models.File) string
- func JsdosMachine(art *models.File) string
- func JsdosMemory(art *models.File) (bool, bool, bool)
- func JsdosRun(art *models.File) string
- func JsdosSound(art *models.File) string
- func JsdosUsage(filename, platform string) bool
- func JsdosUse(art *models.File) bool
- func JsdosUtilities(art *models.File) bool
- func LastModification(art *models.File) string
- func LastModificationAgo(art *models.File) string
- func LastModificationDate(art *models.File) string
- func LastModifications(art *models.File) (int, int, int)
- func LegacyString(s string) string
- func LinkPreview(art *models.File) string
- func LinkPreviewHref(id any, name, platform string) string
- func LinkPreviewTip(art *models.File) string
- func LinkSVG() template.HTML
- func ListContent(art *models.File, src string) template.HTML
- func Magic(art *models.File) string
- func Readme(r *models.File) string
- func ReadmeNone(art *models.File) bool
- func RecordIsNew(art *models.File) bool
- func RecordOffline(art *models.File) bool
- func RecordOnline(art *models.File) bool
- func RecordProblems(art *models.File) string
- func Relations(art *models.File) template.HTML
- func RelationsStr(art *models.File) string
- func ReleaserPair(art *models.File) (string, string)
- func TagCategory(art *models.File) string
- func TagProgram(art *models.File) string
- func Title(art *models.File) string
- func UnID(art *models.File) string
- func Websites(art *models.File) template.HTML
- func WebsitesStr(art *models.File) string
- func ZipContent(art *models.File) string
- type ListEntry
Constants ¶
const (
YYYYMMDD = "2006-Jan-02"
)
Variables ¶
This section is empty.
Functions ¶
func AlertURL ¶
AlertURL returns the VirusTotal URL for the security alert for the file record. This will normally return an empty string unless the file has a security alert.
func AttrArtist ¶
AttrArtist returns the attributed artist names for the file record.
func AttrWriter ¶
AttrWriter returns the attributed text writer names for the file record.
func Description ¶
Description returns a human readable description for the artifact. This includes the title, the releaser and the year of release.
func DownloadID ¶
DownloadID returns the obfuscated ID for the file record. This is used to create a unique download link for the file based on its ID database key.
func EmbedReadme ¶
EmbedReadme returns false if a text file artifact should not be displayed in the page as a readme or textfile. This includes artifacts that are set as documents such a HTML, PDF or BBS RIP images.
func ExtraZip ¶
ExtraZip returns true if the file record has repacked zip file offering in the extra directory. This repackage gets used by the DOS emulator and also offered as an secondary download when the original artifact file uses a defunct compression method or format.
The original artifact must always be preserved and offered as the primary download. But the extra zip file is a convenience for users who may not have the tools to decompress the original.
func FileEntry ¶
FileEntry returns the created and updated date and time for the file record using the "time ago" format.
For example, "Created 2 days ago" or "Updated 1 month ago".
func FirstHeader ¶
FirstHeader returns the title of the file, unless the artifact is marked as a magazine issue, in which case it returns the issue number.
func Idenfication16C ¶
Idenfication16C returns the 16 color identification for the file record. This is usually a partial URL to the 16 color website.
func IdenficationDZ ¶
IdenficationDZ returns the Demozoo production ID for the file record.
func IdenficationGitHub ¶
IdenficationGitHub returns the GitHub repository for the file record.
func IdenficationPouet ¶
IdenficationPouet returns the Pouet production ID for the file record.
func IdenficationYT ¶
IdenficationYT returns the YouTube video watch ID for the file record.
func JsdosArchive ¶
JsdosArchive returns true if the file record is a known MS-DOS archive file.
func JsdosBroken ¶
JsdosBroken returns true if the MsDos artifact is known to be incompatible with the js-dos emulator.
func JsdosMachine ¶
JsdosMachine returns the js-dos machine type for the file record. This is usually the graphic card type but can also be a unique machine type such as "tandy" that is range of hardware.
func JsdosMemory ¶
JsdosMemory returns true if js-dos should disable the XMS, EMS and UMB memory options.
func JsdosRun ¶
JsdosRun returns the program name or sequence of commands to launch in the js-dos emulator.
func JsdosSound ¶
JsdosSound returns the js-dos sound card or built-in audio for the file record.
func JsdosUsage ¶
JsdosUsage returns true if the js-dos emulator should be used with the filename.
func JsdosUse ¶
jsdosUse returns true if the file record is a known, MS-DOS executable. The supported file types are .zip archives and .exe, .com. binaries. Script files such as .bat and .cmd are not supported.
func JsdosUtilities ¶
JsdosUtilities returns true the js-dos emulator should also load the utilities archive as an internal hard disk drive.
func LastModification ¶
LastModification returns the last modified date and time for the file record.
func LastModificationAgo ¶
LastModificationAgo returns the last modified date in a human readable format.
func LastModificationDate ¶
LastModificationDate returns the last modified date for the file record.
func LastModifications ¶
LastModifications returns the year, month and day for the last modified date for the file record.
func LegacyString ¶
LegacyString returns a string that is converted to UTF-8 if it is not already. Intended for filenames in archives that may have been encoded using a legacy charset, such as ISO-8859-1 (Commodore Amiga) or Windows-1252 (Windows 9x) and using non-ASCII characters.
func LinkPreview ¶
LinkPreview returns a URL path to link to the file record in tab, to use as a preview. A preview link is only available for certain file types such as images, text, documents, and renders the whole item in its own browser tab without any HTML or CSS from the website.
func LinkPreviewHref ¶
LinkPreviewHref creates a URL path to link to the file record in tab, to use as a preview.
A list of supported file types: https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Image_types
func LinkPreviewTip ¶
LinkPreviewTip returns a tooltip for the link preview.
func ListContent ¶
ListContent returns a list of the files contained in the archive file.
func ReadmeNone ¶
ReadmeNone returns true if the file record should not display the text file content in the artifact page.
func RecordIsNew ¶
RecordIsNew returns true if the file record is a new upload.
func RecordOffline ¶
RecordOffline returns true if the file record is marked as offline. This means the artifact has been soft deleted and is no longer available for download.
func RecordOnline ¶
RecordOnline returns true if the artifact file record is available for download.
func RecordProblems ¶
RecordProblems returns a list of validation problems for the file record.
func RelationsStr ¶
RelationsStr returns the list of relationships for the file record as a string.
func ReleaserPair ¶
ReleaserPair returns the pair of releaser names for the file record. The first name is the releaser "for" and the second name is the releaser "by".
func TagCategory ¶
TagCategory returns the "Tag as category" for the file record, which is used to group similar artifacts together.
func TagProgram ¶
TagProgram returns the "Programs or apps" for the file record, which is the platform or operating system the artifact is intended for.
func WebsitesStr ¶
WebsitesStr returns the list of links for the file record as a string.
func ZipContent ¶
ZipContent returns the archive content of the file download, or an empty string if not an archive file.