Albirew/nyaa-pantsu
Albirew
/
nyaa-pantsu
Archivé
1
0
Bifurcation 0
Ce dépôt a été archivé le 2022-05-07. Vous pouvez voir ses fichiers ou le cloner, mais pas ouvrir de ticket ou de demandes d'ajout, ni soumettre de changements.
nyaa-pantsu/model/file.go

17 lignes
431 B
Go

package model
type File struct {
ID uint `gorm:"column:file_id;primary_key"`
TorrentID uint `gorm:"column:torrent_id"`
Path string `gorm:"column:path"`
Filesize int64 `gorm:"column:filesize"`
Torrent *Torrent `gorm:"AssociationForeignKey:TorrentID;ForeignKey:torrent_id"`
}
// Returns the total size of memory allocated for this struct
func (f File) Size() int {
return (1 + len(f.Path) + 2) * 8;
}