Documentation
¶
Overview ¶
Package remote provides the remote download and update of artifact data from third-party sources such as API's.
Index ¶
- Variables
- type DemozooLink
- func (got *DemozooLink) ArchiveContent(c echo.Context, db *sql.DB, src string) error
- func (got *DemozooLink) Download(c echo.Context, db *sql.DB, downloadDir string) error
- func (got *DemozooLink) Stat(c echo.Context, db *sql.DB, downloadDir string) error
- func (got DemozooLink) Update(c echo.Context, db *sql.DB) error
- type PouetLink
- func (got *PouetLink) ArchiveContent(c echo.Context, db *sql.DB, src string) error
- func (got *PouetLink) Download(c echo.Context, db *sql.DB, downloadDir string) error
- func (got *PouetLink) Stat(c echo.Context, db *sql.DB, downloadDir string) error
- func (got PouetLink) Update(c echo.Context, db *sql.DB) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrDB = errors.New("database connection is nil") ErrExist = errors.New("file already exists") )
Functions ¶
This section is empty.
Types ¶
type DemozooLink ¶
type DemozooLink struct { ID int `json:"id"` // ID is the Demozoo production ID. UUID string `json:"uuid"` // UUID is the file production UUID. Github string `json:"github_repo"` // GitHub is the GitHub repository URI. YouTube string `json:"youtube_video"` // YouTube is the YouTube watch video URI. Pouet int `json:"pouet_prod"` // Pouet is the Pouet production ID. Releaser1 string `json:"releaser1"` // Releaser1 is the first releaser of the file. Releaser2 string `json:"releaser2"` // Releaser2 is the second releaser of the file. Title string `json:"title"` // Title is the file title. IssuedYear int16 `json:"issued_year"` // Year is the year the file was issued. IssuedMonth int16 `json:"issued_month"` // Month is the month the file was issued. IssuedDay int16 `json:"issued_day"` // Day is the day the file was issued. CreditText []string `json:"credit_text"` // credit_text, writer CreditCode []string `json:"credit_code"` // credit_program, programmer/coder CreditArt []string `json:"credit_art"` // credit_illustration, artist/graphics CreditAudio []string `json:"credit_audio"` // credit_audio, musician/sound Filename string `json:"filename"` // Filename is the file name of the download. FileSize int `json:"file_size"` // Size is the file size in bytes. Content string `json:"content"` // Content is the file archive content. FileType string `json:"file_type"` // Type is the file type. FileHash string `json:"file_hash"` // Hash is the file integrity hash. Platform string `json:"platform"` // Platform is the file platform. Section string `json:"section"` // Section is the file section. Error string `json:"error"` // Error is the error message if the download or record update failed. }
DemozooLink is the response from the task of GetDemozooFile.
func (*DemozooLink) ArchiveContent ¶
func (got *DemozooLink) ArchiveContent(c echo.Context, db *sql.DB, src string) error
ArchiveContent sets the archive content and readme text of the source file.
func (*DemozooLink) Download ¶
func (got *DemozooLink) Download(c echo.Context, db *sql.DB, downloadDir string) error
Download fetches the download link from Demozoo and saves it to the download directory. It then runs Update to modify the database record with various metadata from the file and Demozoo record API data.
type PouetLink ¶
type PouetLink struct { ID int `json:"id"` // ID is the Demozoo production ID. UUID string `json:"uuid"` // UUID is the file production UUID. Demozoo int `json:"demozoo_prod"` // Demozoo production ID. Releaser1 string `json:"releaser1"` // Releaser1 is the first releaser of the file. Releaser2 string `json:"releaser2"` // Releaser2 is the second releaser of the file. Title string `json:"title"` // Title is the file title. IssuedYear int16 `json:"issued_year"` // Year is the year the file was issued. IssuedMonth int16 `json:"issued_month"` // Month is the month the file was issued. IssuedDay int16 `json:"issued_day"` // Day is the day the file was issued. Filename string `json:"filename"` // Filename is the file name of the download. FileSize int `json:"file_size"` // Size is the file size in bytes. Content string `json:"content"` // Content is the file archive content. FileType string `json:"file_type"` // Type is the file type. FileHash string `json:"file_hash"` // Hash is the file integrity hash. Platform string `json:"platform"` // Platform is the file platform. Section string `json:"section"` // Section is the file section. Error string `json:"error"` // Error is the error message if the download or record update failed. }
PouetLink is the response from the task of GetDemozooFile.
func (*PouetLink) ArchiveContent ¶
ArchiveContent sets the archive content and readme text of the source file.
Click to show internal directories.
Click to hide internal directories.