Documentation
¶
Overview ¶
Package record creates an object that can be written as JSON or used as a new database record.
Index ¶
Constants ¶
View Source
const ( FileID = "file_id.diz" // FileID is the filename of the release mini-descriptor. Section = "releaseinformation" // Section releaseinformation is the default category tag for NFOs and file_id.diz. Platform = "text" // Platform text is the default file format or NFOs and file_id.diz. )
View Source
const (
CreateMode = 0o666
)
Variables ¶
View Source
var ( ErrDir = errors.New("the named file points to a directory") ErrGroup = errors.New("record group field cannot be empty") ErrNew = errors.New("new record name and group cannot be empty") ErrPointer = errors.New("pointer value cannot be nil") )
View Source
var ErrFile = errors.New("os file cannot be nil")
Functions ¶
Types ¶
type Download ¶
type Download struct {
Path string // Path to the file that is open for reading and checksums.
Name string // Name of the base file.
Bytes int64 // Bytes size of the file.
HashStrong string // HashStrong is the SHA-386 checksum.
HashWeak string // HashWeak is the MD5 checksum.
Magic string // Magic file type.
ModTime time.Time // ModTime is the last modification date of the file.
ReadTitle string // Title of the release, read from a file_id.diz.
ReadDate time.Time // Publish date of the release, read from a file_id.diz.
}
Download file metadata, the download is usually either a ZIP archive or a single textfile such as an NFO or file_id.diz.
func (*Download) Create ¶
Create a download from the named file. The group must be the formal release-group name.
type Record ¶
type Record struct {
UUID string `json:"uuid"`
Slug string `json:"slug"`
Title string `json:"record_title"`
Group string `json:"group_brand_for"`
FileName string `json:"filename"`
FileSize int64 `json:"filesize"`
FileMagic string `json:"file_magic_type"`
HashStrong string `json:"file_integrity_strong"`
HashWeak string `json:"file_integrity_weak"`
LastMod time.Time `json:"file_last_modified"`
ZipContent string `json:"file_zip_content"`
Published time.Time `json:"date_issued"`
Section string `json:"section"`
Platform string `json:"platform"`
Comment string `json:"comment"`
Readme string `json:"retrotxt_readme"`
TempPath string `json:"temp_path"` // TempPath to the temporary UUID named file download.
}
Record contains the fields that will be used as database cell values.
Click to show internal directories.
Click to hide internal directories.