mirror of
https://github.com/packwiz/packwiz.git
synced 2025-11-19 01:24:32 +01:00
WIP caching system for Modrinth/CurseForge pack export
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package core
|
||||
|
||||
import "io"
|
||||
|
||||
// Updaters stores all the updaters that packwiz can use. Add your own update systems to this map, keyed by the configuration name.
|
||||
var Updaters = make(map[string]Updater)
|
||||
|
||||
@@ -30,3 +32,25 @@ type UpdateCheck struct {
|
||||
// If an error is returned for a mod, or from CheckUpdate, DoUpdate is not called on that mod / at all
|
||||
Error error
|
||||
}
|
||||
|
||||
// MetaDownloaders stores all the metadata-based installers that packwiz can use. Add your own downloaders to this map, keyed by the source name.
|
||||
var MetaDownloaders = make(map[string]MetaDownloader)
|
||||
|
||||
// MetaDownloader specifies a downloader for a Mod using a "metadata:source" mode
|
||||
// The calling code should handle caching and hash validation.
|
||||
type MetaDownloader interface {
|
||||
GetFilesMetadata([]*Mod) ([]MetaDownloaderData, error)
|
||||
}
|
||||
|
||||
// MetaDownloaderData specifies the per-Mod metadata retrieved for downloading
|
||||
type MetaDownloaderData interface {
|
||||
GetManualDownload() (bool, ManualDownload)
|
||||
DownloadFile(io.Writer) error
|
||||
}
|
||||
|
||||
type ManualDownload struct {
|
||||
Name string
|
||||
FileName string
|
||||
DestPath string
|
||||
URL string
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user